Transaction Refund
Transaction Refund can only be performed when a transaction has been charged/settled and is in a CHARGE
state. Any transaction which is not yet settled/charged should be cancelled via the Transaction Reversal function.
You will encounter scenario where it is required to refund a consumer; Either for the full transaction amount in the case of a return of goods, or in some cases for a reduced amount such as a gesture of goodwill. Our Gateway solution allows you to manage this yourself using the tokenId
, but this requires additional integration effort.
To simplify the process, our Checkout solution has the ability for a merchant to perform a refund against the transaction id
, removing the requirement to store the consumers tokenId
. The refund request can be for any value up to the value of the original transaction. Only one refund can be processed against each id
and therefore if additional refunds are required to be made these will have to be completed using the token, via the the Gateway.
Transaction Refund Request
Method | POST |
Transaction Refund | |||
---|---|---|---|
Field Name | State | Data Type | Description |
id | Mandatory | String | Id of the transaction that needs to be refunded. |
amount | Optional | Decimal | Value of transaction to refund. This value cannot be higher than the original authorisation amount. If not supplied the full original transaction amount will be refunded. |
reason | Optional | String | Descriptive text detailing the reason for the refund that is stored against the refund in the “Reporting” and “Settlement” APIs. |
merchantCustomData | Optional | String Max 1024 bytes | Free text field for integrated system to pass custom data that will be stored against the transaction. This data will be returned in the result and available via the “Reporting” API and when using DNA Payments acquiring service the “Settlement” API. |
Example Refund Request
Accept: application/json
Content-Type: application/json
Authorization: Bearer 7KlGv*jFigCc3eReLY1h0yI8O31ZgqITFqyUH6om5w=Vjan=SYnUgeiLQp*_b-c3
{
"id": "6fce7714-6109-40d8-b408-0c6700509b6b",
"amount": 9.99
}
Transaction Refund Response
Transaction Refund Response | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Field Name | Data Type | Description | ||||||||||||
accountId | String | Unique reference for the store processing the transaction. | ||||||||||||
amount | Decimal | Total amount of the original order/authorisation including decimal places where applicable. | ||||||||||||
currency | String | Currency of the transaction.
| ||||||||||||
id | String | Unique transaction ID. | ||||||||||||
invoiceId | String | Order/invoice/transaction/basket number generated by the host website, as passed in the request. | ||||||||||||
message | String | Message confirming the processing result of the transaction request. | ||||||||||||
authDateTimeUTC | dateTime | Time the refund was processed. Format: YYYY-MM-DDTHH:MM:SS.ZZZZZZZZZZZ | ||||||||||||
errorCode | Integer | Provides additional detail should an error have occurred with the transaction.
| ||||||||||||
paymentMethod | String | Payment method used in the refund.
| ||||||||||||
responseCode | String | Returned by the acquirer detailing the result of the transaction. A full list of Response Codes can be found here. | ||||||||||||
rrn | String | Unique reference allocated by us to the authorisation. | ||||||||||||
success | Boolean | Confirms whether the transaction has been successful.
| ||||||||||||
settled | Boolean | Confirms whether the transaction has been submitted for overnight settlement.
| ||||||||||||
parentTransactionId | String | Transaction Id of the original Sale transaction which was subject to this refund request. |
Example Responses
- Successful Response
- Unsuccessful Response
{
"accountId": "uuid000001",
"amount": 1,
"authDateTimeUTC": "2021-05-07T12:42:32.960316497Z",
"currency": "GBP",
"responseCode": 0,
"id": "7f704ff0-80be-4a1b-9ec5-5fd0d4079561",
"invoiceId": "ReadyToBeRefunded",
"message": "Completed successfully",
"parentTransactionId": "4ad2939f-2f51-40aa-af63-f7df02070d1d",
"paymentMethod": "card",
"responseCode": "00",
"rrn": "e83f55bc-5276-4f36-906b-a5aad12c3466",
"settled": true,
"success": true
}
{
"code": 2038,
"message": “Incorrect Transaction state to perform operation. Please check input”,
"success": false
}