Issue a refund
/refundsStandalone Refunds
It is possible to issue a Standalone Refund (i.e. a refund that is not against an existing purchase), such as when refunding from a central account or some other kind of out-of-band refund scenario.
To issue a Standalone Refund, simply provide the card_token or provide card_number, card_holder and card_expiry in lieu of the transaction_id.
Support for Standalone Refunds may vary among banks, so please contact Fat Zebra support if you are unable to successfully issue a Standalone Refund.
Body Parameters
amountinteger (int32)A positive integer representing how much to refund, in the smallest currency unit (e.g. 100 to charge $1.00, or 100 to Charge ¥100, a zero decimal currency).
referencestringMerchant's reference for the refund. Must be unique per refund. Max length 255 characters.
transaction_idstring(optional)ID of the original transaction to be refunded (XXX-P-YYYYYY). Required for an associated refund.
card_tokenstring(optional)Token of the card being refunded. Required unless transaction_id or card details are provided.
card_numberstring(optional)Number of the card being refunded. Required unless transaction_id or card_token are provided.
card_expirystring(optional)Expiry of the card being refunded. Required unless transaction_id or card_token are provided.
card_holderstring(optional)Name on the card being refunded. Required unless transaction_id or card_token are provided.
descriptionstring(optional)Description for the refund.
currencystring(optional)· Defaults to AUDCurrency being refunded. Ignored if transaction_id is present.
descriptorstring(optional)Description that appears on the customer's statement.
extraobject(optional)Extra data for the refund.
metadataobject(optional)Metadata for the refund.
Request
curl https://gateway.pmnts-sandbox.io/v1.0/refunds -u TEST:TEST -d'
{
"transaction_id": "071-P-HEJJINFO",
"amount": 50,
"reference": "ed67e06731a2f98e8f5b3f5bc8540b80"
}'curl https://gateway.pmnts-sandbox.io/v1.0/refunds -u TEST:TEST -d'
{
"card_token": "fke81qwe",
"amount": 349,
"reference": "18jfjh280"
}'Response
{
"successful": true,
"response": {
"authorization": "1536806650",
"id": "071-R-6RQJEWXV",
"amount": 50,
"refunded": "Approved",
"message": "Approved",
"card_holder": "Jim Smith",
"card_number": "512345XXXXXX2346",
"card_expiry": "2023-05-31",
"card_type": "MasterCard",
"transaction_id": "071-R-6RQJEWXV",
"reference": "ed67e06731a2f98e8f5b3f5bc8540b80",
"currency": "USD",
"successful": true,
"transaction_date": "2018-09-13T12:44:10+10:00",
"response_code": "00",
"settlement_date": "2018-09-14",
"metadata": {},
"standalone": false,
"rrn": "071R6RQJEWXV"
},
"errors": [],
"test": true
}{
"successful":false,
"response":{
"authorization":null,
"id":null,
"amount":null,
"refunded":"Error",
"message":null,
"card_holder":"Jim Smith",
"card_number":"512345XXXXXX2346",
"card_expiry":"2023-05-31",
"card_type":"MasterCard",
"transaction_id":null,
"reference":"",
"currency":"USD",
"successful":false,
"transaction_date":null,
"response_code":"99",
"settlement_date":null,
"metadata":{},
"standalone":false,
"rrn":null
},
"errors":[
"Reference can't be blank"
],
"test":true
}{
"successful":false,
"response":{},
"errors":[
"Original transaction could not be found"
],
"test":true
}