Refund
Endpoint : POST https://api.zamplabs.com/payments/v1/refunds
In order to facilitate a refund, we request the merchant to share the payment session id against which the payment has been made, the currency of the refund and the amount to be refunded. Once the post call is made, the refund is initiated. The status of the refund is updated to the merchant with a callback.
Request Body
Key | Value | Description | Optional |
---|---|---|---|
payment_session_id | merchant_8Gtnpzyion6rbcvwb7eP5xid_05_27 | This field denotes the session id against which a refund needs to be generated | N |
reference_id | Reference of id on merchant's system. This is accepted as a string value. | This helps us cross reference orders of merchant's systems associated with refunds | Y |
amount | Numeric value of the amount to be refunded | If left blank, the whole amount will be refunded. Otherwise, the amount mentioned in the request will be refunded | Y |
remarks | string value | This field can be used to add any remarks while initiating a refund request | Y |
Request JSON Representation :
{
"reference_id": "8Gtnpzyion6rbcvwb7eP5xid",
"payment_session_id": "merchant_8Gtnpzyion6rbcvwb7eP5xid_05_27",
"amount": 10,
"remarks": "Refund due to AML Failure",
}
Response Body
Key | Value | Description |
---|---|---|
id | merchant_8Gtnpzyion6rbcvwb7eP5xid_05_27 | This is the refund UUID. Please store this UUID as polling and callbacks of refunds will be made against this UUID |
reference_id | pshM776tAdmyMyZruPjXhK_08_26 | Reference id of the payment session whose refund was initiated |
amount | float64 value | Amount of the money that was refunded |
currency_code | String value | Currency in which refund is processed |
remarks | String value | Remarks used while initiating a refund. |
status | initiated, in_process, succeeded, failed | Status of the refund |
failure_code | Refund Failure Codes | Failure code in case refund is failed |
Response JSON Representation :
{
"data": {
"id": "ReiHsjPSGKGscpAWJ38YyA_08_26",
"merchant_id": "9GtnphjB6rbcvwb7eP5xid_05_27",
"reference_id": "pshM776tAdmyMyZruPjXhK_08_26",
"amount": 10,
"currency_code": "USD",
"remarks": "Refund payment session",
"status": "initiated",
"failure_code":"",
"created_at": "2022-08-26T18:05:14.86225075Z",
"updated_at": "2022-08-26T18:05:14.862250868Z"
}
}