Resend OTP
This will be used to resend OTP request for a transaction. There will be max OTP send limit set for each provider configured.
Note:
See the Resend OTP page in the API Reference section for an official description of this API.
Request
⭣
The request for the Resend OTP API consists of two Path parameters: (id and challenge_id) as listed below:
Field | Type | Description | ||
---|---|---|---|---|
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. |
Path param | id | * | String | Unique id generated for the transaction in a generate OTP API call. |
Path param | challenge_id | * | String | Challenge id generated against the transaction in generating OTP API call. |
* = Required
Example
curl -X POST https://api.juspay.in/v2/txns/txn_36dc6eada1d0463da91dc56c8262a8c3/authenticate/ch_xyz/resend -u your_api_key:
Response
The response for the Resend OTP API consists of the following parameters and objects: (click to open table)
Parameter | Type | Description |
---|---|---|
order_id | String | Order ID for which the payment is being started. This unique Order ID was provided by you while creating order. |
txn_id | String | Transaction ID for the payment attempt. |
txn_uuid | String | Unique ID for the payment attempt to be used in /authenticate and /resend API calls. |
status | String | Status of the transaction. PENDING_VBV indicates that the transaction requires authentication to complete. Please do not validate this at your end.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 |
payment.authenticationwwwi {method, url, params: {...}} | Object String | Returned parameters needed for completing the authentication |
Payment Authentication Object Parameters:
Parameter | Type | Description |
---|---|---|
method | String | HTTP Method for authentication. Can be one of GET or POST (See redirection instructions in the "Handling the Redirection Method" section.) |
url | String | URL to which the user has to be taken to for completing the authentication |
params:wwwwwwwwwwi {param1, param2, ....} | Object String | Present only when the method is POST. This a mapping via a list of key:value pairs that must be sent along with the URL for authentication. Do not hardcode the params in your client * Never assume that you will receive param “x” or param “y”. This is completely dynamic and will vary on a case by case basis. |
Params Object Parameters:
Field | Type | Description |
---|---|---|
id | String | Unique ID generated by Juspay for the transaction. |
challenge_id | String | Authentication ID generated against the transaction for a given order. |
auth_type | String | Authentication method used. In this case, it’s ‘OTP’ |
card_isin | String | Card first 6 digits. |
card_issuer_bank_name | String | Issuer name of the card used for the transaction. (Example: "HDFC Bank") |
times_otp_sent | String | Number of times OTP sent |
max_otp_send_limit | String | Maximum limit for sending OTP |
current_attempt | String | Current attempt for OTP validation. |
max_attempts | String | Maximum number of time OTP validation can be done for a given transaction. |
Example
{
"order_id" : ":order_id",
"txn_id" : ":txn_id",
"status" : "PENDING_VBV",
"payment" : {
"authentication": {
"method": "POST",
"url": "https://api.juspay.in/v2/txns/:id/authenticate",
"params": {
"id" : "8646a7a029974fa99995fec00340a507",
"challenge_id" : "ch_xyz",
"auth_method" : "OTP",
"card_isin" : "424242",
"card_issuer_bank_name" : "AXIS BANK LTD",
"times_otp_sent" : 2,
"max_otp_send_limit" : 4,
"current_attempt" : 1,
"max_attempts" : 4,
}
}
}
}
{
"status": "Invalid Request",
"error_code": "max_limit_exceeded",
"error_message": "Max OTP send limit exceeded."
}
{
"status": "error",
"error_code": "access_denied",
"error_message": "Invalid Authentication"
}
Updated 10 months ago