Refund API
This guide explains how to do translation refund through API call .
REQUEST
testing server:
POST https://staging.xpay.app/api/payments/refund-transaction/
production(Live) server:
POST https://community.xpay.app/api/payments/refund-transaction/
Parameters
Authorization
This method requires authorization, supply the header with a key value pair with that structure
"x-api-key" : string
Required Properties
Property name | Value | Description | Notes |
---|---|---|---|
x-api-key | string | API key linked to your community | generate API key |
โ
Request body
Required Properties
Property name | Value | Description | Notes |
---|---|---|---|
transaction_uuid | string | ID that is uniques to your transaction | |
amount | float | represents the amount to be refunded | If you sent part of the amount you will do partially refund , and if you sent all amount you will do fully refund. |
danger
Hardcoding the customer data in the production version of your app will raise a risk in the payment processor and the transaction will be declined
Optional Properties
Do not supply any optional parameters.
Response
If successful, this method returns a response body with the following structure:
{
{
"status": {
"code": 200,
"message": "success",
"errors": []
},
"data": {
"message": "Transaction was successfully refunded."
},
"count": null,
"next": null,
"previous": null
}"previous": null
}
Example
{
"transaction_uuid": "a3d8fd1c-a919-4f4c-b1c1-2e3f6ad486d6",
"refund_amount": "10"
}
{
"status": {
"code": 201,
"message": "success",
"errors": []
},
"data": {
"message": "Transaction was successfully refunded."
},
"count": null,
"next": null,
"previous": null
}