Resend an OTP [v3]
This API lets you request for an additional otp for a payment that needs to be completed by submitting an otp. It is recommended to be used only after the user has spent more than 30 seconds on your checkout waiting for the otp. There is a limit of 2 times to request an additional otp, after which if you request for an otp the transaction will be marked as failed.
Request Body required
This is the unique transaction id generated in the initiate payment call for which you are requesting a new otp
- 200
- 4XX
- 5XX
When the otp request is successfully placed with the otp sender, the response will be as below
Schema
- Array [
- ]
Possible values: [true
]
Signifies that the otp request was successfully submitted to the otp sender
next object[] required
The next array provides a recommendation for the next API call to be made, where multiple options are available, all of these are provided
Possible values: [complete_payment
]
To complete the payment, you will need to call the API. This is currently only supported for certain pay later providers. If you don't want to natively handle the complete payment flow, you can always redirect the user using the redirect action and the Nimbbl screen will take care of completing the payment
Possible values: [/api/v3/payment
]
This is the end point of the API that needs to be called for the above action, you will need to append the baseurl as provided in this doc
Possible values: [otp
, auto_debit
]
The payment flow provides input whether the complete payment API is expecting an otp or the payment can be completed without any user input i.e. auto_debit. In the case of otp, you will need to provide a screen for the user to enter the otp, please ensure you also have provision for resend otp in case otp isn't delivered. For auto_debit, you can simply call the next API.
{
"otp_sent": true,
"next": [
{
"action": "complete_payment",
"url": "/api/v3/payment",
"payment_flow": "otp"
}
]
}
When the otp request cannot be placed, the response will be as below
Schema
error object
This is the error_code generated by Nimbbl
This is a customer friendly message that can be displayed to your consumer
This explains to your team how to recover from the error
{
"error": {
"nimbbl_error_code": "INVALID_REQUEST_PARAMETER",
"nimbbl_consumer_message": "Sorry, your payment cannot be processed due to a technical error. Please try again after some time.",
"nimbbl_merchant_message": "There is an input validation error, please check the payload of your request."
}
}
When there is a problem on the server, the response will be as below
Schema
error object
This is the error_code generated by Nimbbl
This is a customer friendly message that can be displayed to your consumer
This explains to your team how to recover from the error
{
"error": {
"nimbbl_error_code": "INVALID_REQUEST_PARAMETER",
"nimbbl_consumer_message": "Sorry, your payment cannot be processed due to a technical error. Please try again after some time.",
"nimbbl_merchant_message": "There is an input validation error, please check the payload of your request."
}
}