Use this transaction to refund to a card.
Endpoint : /refund
Refund Request
{
"amount":"20.00",
"linked":"n",
"refid":"12345678987654321234",
"siteid":"123456",
"terminalserialnumber":"6789654678",
"txndate":"2023-02-01:16:13:20",
"type":"refund"
}
Request field specification
Field | Format | Description | |
Required | amount | String e.g. 20.00 |
The amount to be refunded in main units (e.g. £20 would be submitted as 20.00). The amount submitted cannot be higher than the original Sale. |
Required | refid | String (min length: 1) e.g. 1234567890 |
The unique identifier of a previous transaction that is being refunded. |
Required | siteid | String (min length: 1) e.g. 1234 |
Unique identification code supplied by Trust Payments. |
Required | txndate | String e.g. 2020-03-01:10:20:05 |
Unique timestamp for the transaction. |
Required | type | String |
You must submit "refund", as shown in the request example. |
Optional | linked | String |
The following two values can be submitted:
If not submitted, linked defaults to y. |
Optional | terminalserialnumber | String (min length: 1) e.g. 1234567890 |
The unique terminal identifier for the PIN Entry Device (PED) supplying the card details. This is the serial number of the PED. |
Refund Response
{
"amount":"20.00",
"merchantreceipt":"Sample output",
"receipt":"Sample output",
"refid":"12345678987654321234",
"resultcode":"Approved",
"siteid":"123456",
"terminalserialnumber":"6789654678"
}
Response field specification
Field | Format | Description | |
Returned | amount | String e.g. 20.00 |
The original full amount authorised for the transaction in main units (e.g. £20 would be returned as 20.00). Note: The amount may differ from that submitted in the request due to changes made by the customer during checkout (e.g. addition of a tip). |
Returned | refid | String e.g. 1234567890 |
The unique identifier of the previous transaction being refunded. |
Returned | resultcode | String e.g. Approved |
The result of the transaction from the acquirer. Possible values are:
|
Returned | siteid | String e.g. 1234 |
Unique code to identify the Trust Payments site used to process the request. |
Returned | terminalserialnumber | String e.g. 1234567890 |
The unique terminal identifier for the PIN Entry Device (PED) supplying the card details. |
Conditional | error | String e.g. Invalid amount |
The field returns details of an error if a request was not processed successfully. Info on error handling. Only returned if an error has occurred. |
Conditional | errorcode | Integer e.g. 1006 |
This code helps you identify the error if a request was not processed successfully. Info on error handling. Only returned if an error has occurred. |
Conditional | merchantreceipt | String e.g. Merchant Receipt |
Contains merchant receipt data that can be used for printing on the ePOS. Returned if available. |
Conditional | receipt | String e.g. Customer Receipt |
Contains cardholder receipt data that can be used for printing on the ePOS. Returned if available. |