Process OTP
This will complete the authentication and authorization. It takes OTP as input and returns the transaction response.
Request
Method | URL |
---|---|
POST | https://api.juspay.in/v2/txns/:id/authenticate |
Type | Params | Values | Description |
---|---|---|---|
HEADER | api_key | string | |
EMBEDDED | id | string | Unique id generated for the transaction in a generate OTP API call. |
POST | challenge_id | string | Challenge id generated against the transaction in generating OTP API call. |
answer.otp | string | OTP to be sent for authenticating the transaction. | |
auto_capture[optional] | string | Optional parameter. Send false if you want to capture at a later stage. The default is true. |
Example
curl -X POST https://api.juspay.in/v2/txns/:id/authenticate \
-u your_api_key: \
-d "challenge_id=ch_xyz" \
-d "answer.otp=123456"
Response
{
"id": "txn_035b4e708d5148478828ea3136a9efd7",
"order_id": ":order_id",
"txn_id": ":txn_id",
"status": "CHARGED",
"gateway": "RAZORPAY",
"created": "2017-05-05T12:12:08Z",
"resp_code": "00",
"resp_message": "",
"payment_info": {
"payment_method_type": "CARD",
"payment_method": "VISA",
"card": {
"last_four_digits": "",
"card_isin": "400020",
"expiry_month": "09",
"expiry_year": "2020",
"name_on_card": "",
"card_type": "",
"card_issuer": "",
"card_brand": "VISA",
"card_reference": "",
"card_fingerprint": "37sug6sns7p8ubota3md74va3u",
"using_saved_card": false,
"saved_to_locker": false
}
},"payment" : {
"authentication": {
"method": "POST",
"url": "https://api.juspay.in/v2/txns/:id/authenticate",
"params": {
"id" : "8646a7a029974fa99995fec00340a507",
"challenge_id" : "ch_xyz",
"auth_type" : "OTP",
"card_isin" : "424242",
"card_issuer_bank_name" : "AXIS BANK LTD",
“submit_otp_allowed” : true,
“resend_otp_allowed” : false,
“fallback_url” : "https://sandbox.juspay.in/v2/pay/start/guest/eul5g88vzCXbswrHYMh"
}
}
},
"payment_gateway_response": {
"created": "2017-05-05T12:12:42Z",
"txn_id": ":txn_id",
"rrn": "",
"epg_txn_id": ":epg_txn_id",
"auth_id_code": "",
"resp_code": "00",
"resp_message": "",
"gateway_response_map": {
//gateway dependent response parameters
}
},
"refunds":[ ]
}
{
"id": "txn_035b4e708d5148478828ea3136a9efd7",
"order_id": ":order_id",
"txn_id": ":txn_id",
"status": "AUTHENTICATION_FAILED",
"gateway": "RAZORPAY",
"created": "2017-05-05T12:12:08Z",
"resp_code": "00",
"resp_message": "",
"payment" : {
"authentication": {
"method": "POST",
"url": "https://api.juspay.in/v2/txns/:id/authenticate",
"params": {
"id" : "8646a7a029974fa99995fec00340a507",
"challenge_id" : "ch_xyz",
"auth_type" : "OTP",
"card_isin" : "424242",
"card_issuer_bank_name" : "AXIS BANK LTD",
“submit_otp_allowed” : true,
“resend_otp_allowed” : false,
“fallback_url” : "https://sandbox.juspay.in/v2/pay/start/guest/eul5g88vzCXbswrHYMh"
}
}
},
"payment_info": {
"payment_method_type": "CARD",
"payment_method": "VISA",
"card": {
"last_four_digits": "",
"card_isin": "400020",
"expiry_month": "09",
"expiry_year": "2020",
"name_on_card": "",
"card_type": "",
"card_issuer": "",
"card_brand": "VISA",
"card_reference": "",
"card_fingerprint": "37sug6sns7p8ubota3md74va3u",
"using_saved_card": false,
"saved_to_locker": false
}
},
"payment_gateway_response": {
"created": "2017-05-05T12:12:42Z",
"txn_id": ":txn_id",
"rrn": "",
"epg_txn_id": ":epg_txn_id",
"auth_id_code": "",
"resp_code": "00",
"resp_message": "",
"gateway_response_map": {
//gateway dependent response parameters
}
},
"refunds":[ ]
}
{ "status": "invalid_request_error",
"error_code": "invalid",
"error_message": "Invalid authentication account id."}
{ "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. “AUTHORIZED” in case if auto_capture is false. |
gateway | string | Gateway through which authorization process was performed. |
created | string | Creation date of 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