post https://api.sandbox.midtrans.com/v2//expire
Expire transaction is triggered to update the transaction_status
to expire
, when the customer fails to complete the payment. The expired order_id
can be reused for the same or different payment methods.
Expire API can be used in both Core API and Snap integrations.
Expire Transaction Method
See sample on the right -- try it yourself!
HTTP Method | Endpoint | Definition |
---|---|---|
POST | BASE_URL/v2/{order_id OR transaction_id}/expire | Expire the transaction. |
Expire Transaction Response and Notifications
{
"status_code": "407",
"status_message": "Success, transaction has expired",
"transaction_id": "447e846a-403e-47db-a5da-d7f3f06375d6",
"order_id": "vtmbill05",
"payment_type": "echannel",
"transaction_time": "2015-06-15 13:36:24",
"transaction_status": "expire",
"gross_amount": "10000.00"
}
{
"status_code": "202",
"status_message": "midtrans payment notification",
"transaction_id": "841c7da8-530b-435a-9f67-c9d632d15537",
"order_id": "1000176721005355",
"gross_amount": "698879.00",
"payment_type": "bank_transfer",
"transaction_time": "2016-07-04 00:53:55",
"transaction_status": "expire",
"permata_va_number": "8778004890127981",
"signature_key": "f1066b06ec8a4b7d6ffb941fd9772f6df304618e15e02cf17c2914cec12793e19c71653042f7f617b027eae6ecb6759529c67eca9af55264b736408d8b4df2b9"
}
{
"status_code" : "412",
"status_message" : "Merchant cannot modify the status of the transaction"
}
JSON Attribute | Description | Type |
---|---|---|
status_code | Status code of transaction charge result. | String |
status_message | Description of transaction charge result. | String |
transaction_id | Transaction ID given by Midtrans. | String |
order_id | Order ID specified by you. | String |
payment_type | The payment method used by the customer. | String |
transaction_time | Timestamp of transaction in ISO 8601 format. Time Zone: GMT+7. | String |
transaction_status | Transaction status after charge credit card transaction. Possible values arecapture : Transaction is accepted by the bank and ready for settlement. deny : transaction is denied by the bank or FDS.authorize : Credit card is authorized in pre-authorization feature. | String |
gross_amount | Total amount of transaction in IDR. | String |