Refund
Refund a payment back to the shopper.
To return funds to your shopper, you can refund all or part of their payment. For example: if an item in the order is out of stock, you refund that part of the payment.
When you make a refund request for a payment that was only pre-authorised, Datman captures the payment in full first and then refunds it.
Requirements
Before you begin, take into account the following requirements, limitations, and preparations.
| Requirement | Description |
|---|---|
| Integration type | An online payments integration. |
| API credentials | Your api_token, sent in the api_token header. |
| Limitations | The refund can't be more than what's left to refund on the payment. If a payment has not been captured and you don't want to take it, you can reverse the authorisation instead. |
Types of refunds
| Type | Description |
|---|---|
| Full refund | You refund the full amount of the payment. |
| Partial refund | You refund part of the amount of the payment. If you make several partial refunds, the sum of the refund amounts can't be more than the amount of the payment. |
Make a refund
To return funds to the shopper:
-
From the information of the payment you want to refund, get your
order_idand themerchant_id. -
Make a refund request with your
api_tokenheader and the following parameters:Parameter Required Description merchant_idRequired The merchant that took the payment. order_idRequired Your own order reference for the payment, as you sent it when paying. amountRequired The amount to refund, in major units, for example 3.25. Minimum 0.01. reasonWhy the payment is refunded. requested_byWho asked for the refund, for your records. refund_split_feeFor a payment with splits: how much to take back from each merchant that received part of the payment. Each item has partner_merchant_idandrefund_amount. The total can't be more thanamount.The Refund a payment page in the API Explorer has the full request, with examples you can try.
-
When you receive the response, note:
outcome: success when the refund was made, or failed when it wasn't. Errors are returned with HTTP 200, so always checkoutcome.destination: the amount refunded to each destination, as strings, for exampleCARD3.25.transaction_methods: the payment method of the original payment (ECOM, GPAY, APPLEPAY or WALLET) and its original total, as strings.message: present for an uncaptured pre-authorisation, which is captured first and then refunded.
Example response for a refund request
{ "outcome": "success", "destination": { "CARD": "3.25" }, "transaction_methods": { "ECOM": "27.75" } } -
To check the refunds recorded against a payment, get the refunds recorded against the transaction.
Reasons for a failed refund
When a refund fails, you receive outcome failed and a message with the reason. The next table shows the most common reasons.
message | Description |
|---|---|
Refund amount (30.00) cannot be greater than the original transaction amount (24.50). | The refund amount is more than the amount of the payment. |
Transaction already refunded: <reason> | The payment has already been refunded. |
No transaction found for order_id : <order_id> and merchant_id: <merchant_id> | No payment matches the order_id and merchant_id. |
Refund split amount (5.00) cannot be greater than the total refund amount (3.25). | The total of refund_split_fee is more than amount. |
Refund amount cannot be greater than the authorised amount | For a pre-authorisation, the refund amount is more than the authorised amount. |
Pre-auth refund already in progress | A refund of this pre-authorisation is already being processed. |
Token is empty or Invalid token | The api_token header is missing or invalid. |

