Refund a Payment [v3]
This API lets you refund a successful payment transaction. This will result in the amount requested by you in the API call returned to the customer in the payment mode they had originally used. Refund transactions once requested cannot be rolled back so you should be very sure of the amount.
Request Body required
This is the Nimbbl provided transaction_id. You would have received this when you initiated a payment and subsequently in other API responses as well. You need to either provide the transaction_id
or the invoice_id
This is the amount that you want to refund. If you want to refund the entire payment amount, you need not send the amount explicitly. However, for partial refunds, you have to send the amount
This is the unique reference with which you had created an order. You can also pass this to initiate a response if you don't have the Nimbbl transaction_id. You need to either provide the transaction_id
or the invoice_id
This is the unique identifier that can be sent to identify refund requests. It helps in avoiding incorrect multiple partial refunds. If passed then it will be used to validate if another refund request for the same id is not succeeded or pending
- 200
- 4XX
- 5XX
When the refund request is accepted for processing, the response will be as below
Schema
- Array [
- ]
This is the transaction_id of the payment transaction that is being refunded
This is the unique transaction_id generated for this refund transaction
This is the refund_request_id provided in the request
Possible values: [new
, pending
, succeeded
, failed
]
This is the status of the refund transaction
This is the bank or acquirer reference number for the refund. Only available for succeeded refunds, though not available in real time. Your customer can provide this reference number to their bank to check if refund is yet to be credited in their account
Possible values: [partial_refund
, full_refund
]
This is the type of refund that has been accepted for processing
error object nullable
If the refund 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.
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: [refund_enquiry
]
If you don't get the final status of the refund 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
{
"orignal_payment_transaction_id": "o_Rz4Zx2WeyooEpyxa-221117104614",
"transaction_id": "o_Rz4Zx2WeyooEpyxa-230417104614",
"refund_request_id": "ref_req_12345",
"refund_status": "failed",
"refund_arn": "ref_arn_12345",
"transaction_type": "full_refund",
"error": {
"nimbbl_error_code": "PSP_INSUFFICIENT_BALANCE",
"nimbbl_consumer_message": "Sorry, your refund could not be processed. Please try again or another payment option.",
"nimbbl_merchant_message": "The refund cannot be processed as your account doesn't have sufficient balance with the PSP to honour this refund, please transfer funds to the PSP and try the refund again.",
"retry_allowed": true
},
"next": [
{
"action": "refund_enquiry",
"url": "/api/v3/transaction-enquiry"
}
]
}
When the refund cannot be processed, 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."
}
}