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

TypeParamsValuesDescription
HEADERapi_keystring
EMBEDDEDtxn_uuidstringtxn_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 ParamsValuesDescription
idstringUnique id generated for the transaction.
order_idstringOrder Id provided by you while order creation.
txn_idstringTransaction id for a given order.
statusstringStatus of the transaction. If you receive “CHARGED”, then the transaction is successful.
gateway_idstringGateway through which authorization process was performed.
createdstringCreation date of the transaction.
resp_codestringGateway response code for the transaction.
resp_messagestringError message from the gateway in case if the transaction failed.
payment_infoobjectThis contains the payment details provided during the transaction.
payment_gateway_responseobjectThis will give the payment response received from the gateway.
refundsarrayList of refunds attempted for a given transaction.