Capture Transaction
This will capture the transaction which is in the AUTHORIZED state.
NOTE: Please note the transaction status in response to Capture API, when the underlying Payment gateways send:
- Success => CHARGED
- Failed => CAPTURE_FAILED
- Pending and accepted by gateway => CAPTURE_INITIATED
- Timeout/no response from PG => AUTHORIZED
The orders should be captured within 7 days of transaction initiation.
Request
Method | URL |
---|---|
POST | https://api.juspay.in/v2/txns/:txn_uuid/capture |
Type | Params | Values | Description |
---|---|---|---|
HEADER | api_key | string | |
EMBEDDED | txn_uuid | string | txn_uuid available in Order Status API response |
Example
curl -X POST https://api.juspay.in/v2/txns/euld46jp7R1jE3tB8ss/capture \
-u your_api_key:
Response
{
"udf9": "",
"udf8": "",
"udf7": "",
"udf6": "",
"udf5": "",
"udf4": "",
"udf3": "",
"udf2": "",
"udf10": "",
"udf1": "",
"txn_uuid": "euld46jp7R1jE3tB8ss",
"txn_id": "merchant_id-order_id-1",
"status_id": 21,
"status": "CHARGED",
"return_url": "https://sandbox.juspay.in",
"refunded": false,
"product_id": "",
"payment_method_type": "CARD",
"payment_method": "MASTERCARD",
"payment_links": {
"web": "https://api.juspay.in/merchant/pay/ord_7f609710bf6f4379b5917ee5afd8386b",
"mobile": "https://api.juspay.in/merchant/pay/ord_7f609710bf6f4379b5917ee5afd8386b?mobile=true",
"iframe": "https://api.juspay.in/merchant/ipay/ord_7f609710bf6f4379b5917ee5afd8386b"
},
"payment_gateway_response": {
"txn_id": "merchant_id-order_id-1",
"rrn": "",
"resp_message": "Capture successful",
"resp_code": "SUCCESS",
"epg_txn_id": "14326152",
"created": "2019-03-01T08:34:40Z",
"auth_id_code": "NA"
},
"order_id": "92348923409",
"merchant_id": "merchant_id",
"id": "ord_7f609710bf6f4379b5917ee5afd8386b",
"gateway_id": 70,
"date_created": "2019-03-01T08:33:49Z",
"customer_phone": null,
"customer_id": "FUR14920977945",
"customer_email": null,
"currency": "INR",
"card": {
"using_saved_card": true,
"saved_to_locker": false,
"name_on_card": "test",
"last_four_digits": "",
"expiry_year": "2022",
"expiry_month": "07",
"card_type": "DEBIT",
"card_reference": "aa301450fe38c65cd813a8c33897942b",
"card_issuer": "HDFC Bank",
"card_isin": "541919",
"card_fingerprint": "6rds4re1p3678ftk333q64gs1g",
"card_brand": "MASTERCARD"
},
"bank_error_message": "PRE_AUTH|Transaction Successful | Approved",
"bank_error_code": "SUCCESS",
"auth_type": "THREE_DS",
"amount_refunded": 0,
"amount": 10
}
},
"refunds":[ ]
}
{
"status": "Bad Request",
"error_message": "Cannot capture charged transaction",
"error_code": "Invalid"
}
{
"status": "error",
"error_code": "access_denied",
"error_message": "Invalid Authentication"
}
Response Params | Values | Description |
---|---|---|
id | string | Unique id generated for the transaction. |
order_id | string | Order Id provided by you while order creation. |
txn_id | string | Transaction id for a given order. |
status | string | Status of the transaction. If you receive “CHARGED”, then the transaction is successful. |
gateway_id | string | Gateway through which authorization process was performed. |
created | string | Creation date of the transaction. |
resp_code | string | Gateway response code for the transaction. |
resp_message | string | Error message from the gateway in case if the transaction failed. |
payment_info | object | This contains the payment details provided during the transaction. |
payment_gateway_response | object | This will give the payment response received from the gateway. |
refunds | array | List of refunds attempted for a given transaction. |
Updated over 2 years ago