post https://api.juspay.in/v2/txns//capture
This will perform a capture on the successfully authorized transaction. Use this in case auto_capture was false during the authentication process.
The response for the Capture API consists of the following parameters and objects: (click to open table)
Parameter | Type | Description |
---|---|---|
id | String | Unique ID generated by Juspay for the transaction. |
order_id | String | Unique Identifier for the order provided by you while creating order. Maximum length should be 21 characters. |
txn_id | String | Transaction ID for a given order. |
status | String | Status of the transaction. If you receive “CHARGED”, then the transaction is successful. “AUTHORIZED” in case if 'auto_capture' is false.Status codes and meaning10 21 24 23 26 27 22 28 NEW Newly created order CHARGED Successful transaction AUTHORIZED In cases where 'auto_capture' is false PENDING_VBV Authentication is in progress AUTHENTICATION_FAILED User did not complete authentication AUTHORIZATION_FAILED User completed authentication, but bank refused the transaction JUSPAY_DECLINED User input is not accepted by the underlying PG AUTHORIZING Transaction status is pending from bank |
gateway | String | Gateway through which authorization process was performed. |
created | String | Date/time (ISO representation) when transaction was initiated |
resp_code | String | Gateway response code for the transaction. |
resp_message | String | Error message from the gateway in case if the transaction failed. |
refunded | Boolean | True if there are any refunds attempted for a given transaction. (Used to enable "refunds" array?) |
payment_info:wwwwwwwwn {param1, param2, ....} | Object String | Object containing payment and card details provided during the transaction. |
Payment Info Object Parameters:
Field | Type | Description |
---|---|---|
payment_method_type | String | Must be CARD. |
payment_method | String | One of VISA/MASTERCARD/MAESTRO/AMEX/RUPAY. |
card:wwwwwwwwwwin {param1, param2, ....} | Object String | Object containing credit/debit card details |
Card Object Parameters:
Field | Type | Description |
---|---|---|
last_four_digits | String | Last four digits of card number |
card_isin | String | International Securities Identification Number for card |
expiry_month | String | Expiry month of the card (Format: mm) Example: 06 |
expiry_year | String | Expiry year of the card (Format: yyyy) Example: 2020 |
name_on_card | String | Card holder name. Should contain alphabetical characters only. |
card_type | String | "CREDIT" or "DEBIT" |
card_issuer | String | Code for bank that issued the card (Example: "HDFC Bank") |
card_brand | String | Brand of card (MASTERCARD, VISA, etc.) |
card_reference | String | Reference code for the card |
card_fingerprint | String | Fingerprint code for the card |
using_saved_card | Boolean | True if using a saved card |
saved_to_locker | Boolean | True if card has been saved to locker |
payment_gateway_response: {param1, param2, ....} | Object String | This will give the payment response received from the gateway |
Payment Gateway Response Object Parameters:
Field | Type | Description | Example |
---|---|---|---|
txn_id | String | Transaction ID | "11327833" |
rrn | String | Authorization Retrieval Reference Number | "502913366745" |
resp_message | String | Error message from the gateway in case if the transaction failed. | "Payment Successful" |
resp_code | String | Gateway response code for the transaction. | "0" |
epg_txn_id | String | Electronic Payment Gateway transaction ID | "1532690566017" |
created | String | Date time (ISO representation) when transaction was initiated. | "2020-04-28T06:31:37Z" |
auth_id_code | String | Authorization ID Code | "475926" |
gateway_response_mapi {param1, param2, ....} | Object String | gateway dependent response parameters |
Refunds: [{...},{...},..] wwwwwwwwwwwwwwwww | Array wwwwt | An array of Refund Objects with details of each refund attempted for a given transaction (returned only if the refunded parameter is set to "true". |
Parameters for each object in the Refunds array:
Field | Type | Description |
---|---|---|
unique_request_id | String | The unique request ID that is passed during refund initiation. Do not pass any special characters. |
status | String | The status of the refund initiated. Initial status will always be PENDING Status codes and meaningSUCCESS This means that the refund has been successfully executed. PENDING This would mean that the refund has been queued withJusPay or with the downstream system. FAILURE We were unable to process the refund successfully. You have to try again with a new unique_request_id .MANUAL_REVIEW This would mean that the refund request was sent an ambigious response from the payment gateway and the merchant has to manually reconcile it with the payment gateway to get the proper response. Also, any refunds which are in pending for more than 10 days are sent for manual review. |
sent_to_gateway | Boolean | The flag denotes if the refund was initiated to gateway. The initial status is always false, as refunds are queued at Juspay for a maximum of 15 minutes. |
refund_type | String | The type of refund. Values can be STANDARD or INSTANT |
refund_source | String | The name of gateway |
ref | String | The refund ID provided by the PG |
initiated_by | String | The source of initiation |
id | String | The reference ID provided by PG, if not available then its mapped to the unique request ID. |
error_message | String | The error message provided by the PG |
error_code | String | The error code provided by the PG |
amount | Integer | The refund amount passed in the request |
created | Time- stamp | The timestamp when refund was created |
⭣The request for the Capture API consists of one Path parameter: id, as listed below: (click to open table)
The request for the Capture API consists of one Path parameter: id, as listed below: (click to open table)
Field | Type | Description | ||
---|---|---|---|---|
Path param | id | * | String | Unique id generated for the transaction in a generate OTP API call. |
Header (-u) | your_api_key | * | String | API key can be obtained from https://merchant.juspay.in/settings/api-key. Provide your API key as the basic auth username value. You do not need to provide a password. |
* = Required