Complete a Payment [v3]
This API helps you complete a payment that you have already initiated. You need to call this API typically to submit an otp or a token to complete the payment. Currently this API is used only for certain Pay Later providers where you want to provide a native otp experience.
Request Body required
- Get the Nimbbl Public key for encryption. To get the Nimbbl public key reach out to us at
help@nimbbl.biz
. - Format the Card details in the format :
{"otp":"123233"}
- Encrypt the above card details using the RSA encryption.
The transaction_id for which the payment needs to be completed, this should be the same as returned in the response of initiate payment
Possible values: [otp
, auto_debit
]
There are two ways to complete the payment flow, either by the customer submitting an otp or without any consumer action when an auto_debit token exists for the user. The flow to be sent here will come in the response of v3/initiate-payment API. If the flow is otp
, you will need to provide an OTP entry screen for your customer.
This is the OTP that is sent to the customer to authenticate the transaction. You need to pass it when the payment_flow is otp
You can always encrypt the OTP on your client and send us the encrypted OTP string in this key.
Steps for encryption
- 200
- 4XX
- 5XX
When the payment completion request is successful, the response will be as below
Schema
- Array [
- ]
This is the transaction id passed in the request
Possible values: [succeeded
, pending
, failed
]
This is the current status of the payment transaction
This a message explaining the status of the payment
This is base64 encoded version of the Nimbbl response. You will need to decode this and take out the nimbbl_signature
error object nullable
If the payment has failed, you can get the reason for failure from the error object
This is the error_code generated by Nimbbl
This is a customer friendly message that can be displayed to your consumer or shared by your customer service agent to the customer
This explains to your team how to recover from the error
This field suggests whether a retry should be allowed for the customer using the same payment mode.
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: [payment_enquiry
]
If you don't get the final status of the payment transaction, you can always query the latest transaction status by doing an enquiry.
Possible values: [/api/v3/transaction-enquiry
]
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
{
"transaction_id": "o_9yo5wxlLlbJGK6dp-231210182525",
"payment_status": "failed",
"message": "Payment failed",
"base64_message": "eyJwYXlsb2FkIjp7Im5pbWJibF9vcmRlcl9pZCI6Im9fQmI1YWJFNGpEcGRSWm40RCIsIm5pbWJibF90cmFuc2FjdGlvbl9pZCI6Im9fQmI1YWJFNGpEcGRSWm40RC0yMzA4MDIwNTE1MjEiLCJuaW1iYmxfc2lnbmF0dXJlIjoiYzkyMWFiMzI5ZmUxYmY3NjY0ZDYwYjI0ZTE2NGYyNjg5OGMyNzRjM2RiYzNkNGRjN2UyZTNhNDc0MDc0MjY3NiIsIm9yZGVyX2lkIjoib19CYjVhYkU0akRwZFJabjREIiwidHJhbnNhY3Rpb25faWQiOiJvX0JiNWFiRTRqRHBkUlpuNEQtMjMwODAyMDUxNTIxIiwic2lnbmF0dXJlIjoiYzkyMWFiMzI5ZmUxYmY3NjY0ZDYwYjI0ZTE2NGYyNjg5OGMyNzRjM2RiYzNkNGRjN2UyZTNhNDc0MDc0MjY3NiIsInN0YXR1cyI6InN1Y2Nlc3MifX0",
"error": {
"nimbbl_error_code": "CUSTOMER_INSUFFICIENT_FUNDS",
"nimbbl_consumer_message": "Unfortunately, you don't have sufficient balance in your account to make this payment. Please try another payment option.",
"nimbbl_merchant_message": "Customer doesn't have sufficient funds to complete the transaction.",
"retry_allowed": false
},
"next": [
{
"action": "payment_enquiry",
"url": "/api/v3/transaction-enquiry"
}
]
}
When the payment completion request is not successful, 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."
}
}