post https://api.sandbox.midtrans.com/v2/capture?
Capture transaction is triggered to capture the transaction balance when transaction_status:authorize
. This is only available after Pre-Authorized Credit Card or Pre-Authorized GoPay.
Capture Transaction Method
See sample on the right -- try it yourself!
HTTP Method | Endpoint | Definition |
---|---|---|
POST | BASE_URL/v2/capture | Capture an authorized transaction for card payment. |
Capture Transaction Request
{
"transaction_id": "be4f3e44-d6ee-4355-8c64-c1d1dc7f4590",
"gross_amount": 145000
}v
JSON Attribute | Description | Type | Required |
---|---|---|---|
transaction_id | Transaction ID given by Midtrans. | String(255) | Required |
gross_amount | Total amount of transaction in IDR. By default it captures whole transaction amount. Note: Decimal values are invalid. | Long | Optional |
Capture Transaction Response
{
"status_code" : "200",
"status_message" : "Success, Credit Card capture transaction is successful",
"transaction_id" : "ca297170-be4c-45ed-9dc9-be5ba99d30ee",
"masked_card" : "45111111-1117",
"order_id" : "testing-0.4555-1414741517",
"payment_type" : "credit_card",
"transaction_time" : "2014-10-31 14:46:44",
"transaction_status" : "capture",
"fraud_status" : "accept",
"bank" : "bni",
"gross_amount" : "30000.00",
"channel": "dragon",
"expiry_time":"2014-11-08 14:46:44",
"settlement_time":"2014-10-31 19:00:00"
}
{
"status_code" : "412",
"status_message" : "Merchant cannot modify the status of the transaction"
}
JSON Attribute | Description | Type |
---|---|---|
status_code | Status code of transaction capture result. | String |
status_message | Description of transaction capture result. | String |
order_id | Order ID specified by you. | String |
transaction_id | Transaction ID given by Midtrans. | String |
masked_card | First 8-digits and last 4-digits of customer's card number. | String |
gross_amount | Total amount of transaction in IDR. | 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 capture card transaction. | String |
fraud_status | Detection result by Fraud Detection System (FDS). Possible values areaccept : Approved by FDS.deny : Denied by FDS. Transaction automatically failed. | String |
bank | The name of the acquiring bank. | String |
gross_amount | Total amount of transaction in IDR. | String |
channel | The name of the payment channel provider. Provided if channel attribute on charge api request is present. More details on request and possible values are available on Card Feature: Specific Channel. | String |
expiry_time | For regular card transactions (non-recurring, non-one-click, non-two-click token) and the 3DS redirect_url expires in 10 minutes. For authorized transaction expires in 8 days. | String |
settlement_time | Credit card settlement time refers to the duration it takes for a credit card transaction to be processed and transaction_status change to settlement. | String |