If you want to return funds to a shopper's gift card, you can make a referenced refund or an unreferenced refund:
-
Referenced refund: a
ReversalRequest
with a reference to the original payment. Use this if you want to refund a payment made with this gift card. You can also make (multiple) partial refunds in this way. -
Unreferenced refund: a
PaymentRequest
withPaymentType
Refund. Use this if you cannot connect the refund to a payment made with the gift card but still want to return the funds to this gift card. For example, in a 'merchandise return' where the shopper returns an unwanted birthday gift. That is what we describe here on this page.
If you want to give the balance of a gift card to a shopper in cash, you should make a cashback request instead.
Requirements
Before you make any gift card transactions, make sure that you have:
- Built an integration that can make a payment.
- Completed the onboarding process with your gift card provider.
- Added the payment method to your Adyen account.
Make an unreferenced refund
To issue a refund to a gift card:
- Determine the card entry method:
- If you want to scan the card, do that first and use the obtained card details in your request.
- If you want to swipe the card or use manual keyed entry (MKE), send the request first. The payment terminal will show a prompt to swipe the card or enter the card details.
-
Make a POST request to a Terminal API endpoint, specifying:
-
MessageHeader
: the standardSaleToPOIRequest.MessageHeader
object. Specify:Parameter Required Description ProtocolVersion
3.0 MessageClass
Service MessageCategory
Payment MessageType
Request ServiceID
Your unique ID for this request, consisting of 1-10 alphanumeric characters. Must be unique within the last 48 hours for the terminal ( POIID
) being used.SaleID
Your unique ID for the POS system component to send this request from. POIID
The unique ID of the terminal to send this request to. Format: [device model]-[serial number].
-
PaymentRequest.SaleData
. This includes:Parameter Required Description SaleTransactionID.TransactionID
Your reference to identify this refund. SaleTransactionID.TimeStamp
Date and time of the request, in UTC format. SaleReferenceID
Your reference to the order that you want to do a refund for. In the Customer Area, it will appear as the Merchant Order for the transaction. SaleToAcquirerData
- Optional for manually keying in the card number (MKE): maxLength and cardMask. Use these fields to specify card numbers with more than 24 digits.
- Optional for Stored Value Solutions (SVS) gift cards: ssc. This is the secondary security code of the gift card, and allows up to 8 digits. For example,
ssc
: 1111.
To add these, follow the instructions below.
InSaleData.SaleToAcquirerData
, specify the parameter in one of the following formats:-
Option 1: a JSON object converted to a Base64 encoded string.
Encode{"maxLength": "27", "cardMask": "****-****-****-****-****-****-***"}
to Base64, and pass the resulting string:
"SaleToAcquirerData": "eyJtYXhMZW5ndGgiOiAiMjciLCAiY2FyZE1hc2siOiAiKioqKi0qKioqLSoqKiotKioqKi0qKioqLSoqKiotKioqIn0="
-
Option 2: a key-value pair:
"SaleToAcquirerData": "maxLength=27&cardMask=****-****-****-****-****-****-***"
The format that you use here will also be the format of the
AdditionalResponse
that you receive. If there are more tender options (for example, ReceiptHandler ) or other data elements that you need to pass in theSaleToAcquirerData
field, refer to Add information to a payment.
-
PaymentRequest.PaymentTransaction
. This includes:Parameter Required Description AmountsReq
The Currency
andRequestedAmount
being refunded to the gift card. -
PaymentRequest.PaymentData
. This includes:Parameter Required Description PaymentType
Refund PaymentInstrumentData.PaymentInstrumentType
StoredValue PaymentInstrumentData.StoredValueAccountID
The gift card details: StoredValueAccountType
: GiftCardStoredValueProvider
: the gift card issuer: givex, svs, valuelink, or any Intersolve-supported card type.IdentificationType
: PAN.EntryMode
,StoredValueID
andExpiryDate
: these parameters depend on the card entry method you are using. See the following table.
Card entry Parameters Scan EntryMode
: ScannedStoredValueID
: gift card number.ExpiryDate
: expiry date of the gift card.
Swipe EntryMode
: MagStripeStoredValueID
: include this parameter but do not provide a value.
MKE EntryMode
: KeyedStoredValueID
: include this parameter but do not provide a value.
The example below shows how to issue a refund of GBP 30.00 to a scanned gift card.
-
The refund request is sent to the Adyen payments platform for processing.
See the PaymentRequest API reference.
Refund response
Once processed, your integration receives the refund result. This is provided in a synchronous API response, unless your integration uses asynchronous cloud communications.
If your integration uses asynchronous cloud communications, you receive the response as an event notification.
If the refund request is successful:
-
You receive a response with a
PaymentResponse
object that includes:POIData.POITransactionID.TransactionID
: transaction identifier for the refund.PaymentReceipt
: object containing data you can use to generate a receipt.Response.Result
: Success
The example below indicates that the refund of GBP 30.00 was successfully issued to the gift card.
See the PaymentResponse API reference.
{ "SaleToPOIResponse":{ "PaymentResponse":{ "POIData":{ "POITransactionID":{ "TimeStamp":"2019-06-22T12:20:31.000Z", "TransactionID":"u6W7001529670031000.NC6HT9CRT65ZGN82" } }, "SaleData":{ "SaleTransactionID":{ "TimeStamp":"2019-06-22T12:20:27.000Z", "TransactionID":"44741" }, "SaleReferenceID":"SalesRefABC" }, "PaymentReceipt":[...], "PaymentResult":{ "PaymentAcquirerData":{ "AcquirerPOIID":"V400m-324688179", "AcquirerTransactionID":{ "TimeStamp":"2019-06-22T12:20:31.000Z", "TransactionID":"NC6HT9CRT65ZGN82" }, "MerchantID":"TestMerchantPOS" }, "PaymentInstrumentData":{ "StoredValueAccountID":{ "IdentificationType":"PAN", "EntryMode":[ "MagStripe" ], "StoredValueID":"603628173862001915498", "StoredValueAccountType":"GiftCard", "StoredValueProvider":"givex", "ExpiryDate":"1249" }, "PaymentInstrumentType":"StoredValue" }, "AmountsResp":{ "AuthorizedAmount":30.00, "Currency":"GBP" }, "PaymentType":"Refund" }, "Response":{ "Result":"Success", "AdditionalResponse":"..." } }, "MessageHeader":{ "ProtocolVersion":"3.0", "SaleID":"POSSystem", "MessageClass":"Service", "MessageCategory":"Payment", "ServiceID":"9268", "POIID":"V400m-324688179", "MessageType":"Response" } } }