{"title":"Make a refund to a gift card","category":"default","creationDate":1779533779,"content":"<p>If you want to return funds to a shopper's gift card, you can make a referenced refund or an unreferenced refund:<\/p>\n<ul>\n<li>\n<p><strong>Referenced refund<\/strong>: a <code>ReversalRequest<\/code> with a reference to the original payment's transaction identifier. Use this if you want to refund a payment made with this gift card. The transaction identifier references the gift card details, so you do not need to specify them in the refund request. You can also make (multiple) partial refunds in this way. For the detailed steps, refer to <a href=\"\/point-of-sale\/basic-tapi-integration\/refund-payment\/referenced\">Referenced refund<\/a>.<\/p>\n<\/li>\n<li>\n<p><strong>Unreferenced refund<\/strong>: a <code>PaymentRequest<\/code> with <code>PaymentType<\/code> <span translate=\"no\"><strong>Refund<\/strong><\/span>. 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. Because an unreferenced refund to a gift card requires specifying the gift card details, we explain this transaction on this page.<\/p>\n<\/li>\n<\/ul>\n<div class=\"notices yellow\">\n<p>If you want to give the balance of a gift card to a shopper in cash, you should <a href=\"\/point-of-sale\/gift-cards-terminal-api\/deactivate#cashing-back-gift-card\">make a cashback request<\/a> instead.<\/p>\n<\/div>\n<h2>Requirements<\/h2>\n<p>Before you begin, take into account the following requirements, limitations, and preparations.<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Requirement<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><strong>Integration type<\/strong><\/td>\n<td style=\"text-align: left;\">A <a href=\"\/point-of-sale\/design-your-integration\/terminal-api\">Terminal API<\/a> integration with payment terminals.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><strong>Setup steps<\/strong><\/td>\n<td style=\"text-align: left;\">Before you begin: <ul><li markdown=\"1\"><a href=\"\/point-of-sale\/what-we-support\/payment-methods#add-payment-methods-to-your-account\">Add the payment method to your Adyen account<\/a>.<\/li><li markdown=\"1\">Complete the onboarding process with the gift card provider.<\/li><\/ul><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>Make an unreferenced refund<\/h2>\n<p>To issue a refund to a gift card:<\/p>\n<ol>\n<li>\n<p>Determine the <a href=\"\/point-of-sale\/gift-cards-terminal-api#card-entry\">card entry method<\/a>:<\/p>\n<ul>\n<li>If you want to scan the card, do that first and use the obtained card details in your request.<\/li>\n<li>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.<\/li>\n<\/ul>\n<\/li>\n<li>\n<p><a href=\"\/point-of-sale\/basic-tapi-integration\/make-a-payment\">Make a payment request<\/a>, specifying:<\/p>\n<ul>\n<li>\n<p>The standard <a href=\"\/point-of-sale\/design-your-integration\/terminal-api#request-message-header\">\n  <code>SaleToPOIRequest.MessageHeader<\/code>\n<\/a> object, with <code>MessageClass<\/code> set to <span translate=\"no\"><strong>Service<\/strong><\/span> and <code>MessageCategory<\/code> set to <span translate=\"no\"><strong>Payment<\/strong><\/span>.<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter<\/th>\n<th style=\"text-align: center;\">Required<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>ProtocolVersion<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\"><strong>3.0<\/strong><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>MessageClass<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>Service<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>MessageCategory<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>Payment<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>MessageType<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>Request<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>ServiceID<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">Your unique ID for this request, consisting of 1-10 alphanumeric characters. Must be unique within the last 48 hours for the terminal (<code>POIID<\/code>) being used.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>SaleID<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">Your unique ID for the POS system component to send this request from.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>POIID<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">The unique ID of the terminal to send this request to. Format: <em>[device model]-[serial number]<\/em>.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>The  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/terminal-api\/latest\/post\/payment#request-SaleData\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">PaymentRequest.SaleData<\/a> object with:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter<\/th>\n<th style=\"text-align: center;\">Required<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>SaleTransactionID.TransactionID<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">Your reference to identify this refund.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>SaleTransactionID.TimeStamp<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">Date and time of the request, in <a href=\"https:\/\/en.wikipedia.org\/wiki\/ISO_8601#Coordinated_Universal_Time_(UTC)\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">UTC format<\/a>.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>SaleReferenceID<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">Your reference to the order that you want to do a refund for. In the <a href=\"https:\/\/ca-test.adyen.com\/\" target=\"_blank\" rel=\"nofollow noopener noreferrer\" class=\"external-link no-image\">Customer Area<\/a>, it will appear as the <strong>Merchant Order<\/strong> for the transaction.<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>SaleToAcquirerData<\/code><\/td>\n<td style=\"text-align: center;\"><\/td>\n<td style=\"text-align: left;\"><ul><li markdown=\"1\">Optional for manually keying in the card number (MKE): <span translate=\"no\"><strong>maxLength<\/strong><\/span> and <span translate=\"no\"><strong>cardMask<\/strong><\/span>. Use these fields to specify card numbers with more than 24 digits.<\/li><li markdown=\"1\">Optional for Stored Value Solutions (SVS) gift cards: <span translate=\"no\"><strong>ssc<\/strong><\/span>. This is the secondary security code of the gift card, and allows up to 8 digits. For example, <code>ssc<\/code>: <strong>1111<\/strong>. <br> To add these, follow the <a href=\"#sale-to-acquirer-data\">instructions below<\/a>.<\/li><\/ul><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><a id=\"sale-to-acquirer-data\"><\/a><br \/>\nIn <code>SaleData.SaleToAcquirerData<\/code>, specify the parameter in one of the following formats:<\/p>\n<ul>\n<li>\n<p>Option 1: a JSON object converted to a Base64 encoded string.<br \/>\nEncode <code>{\"maxLength\": \"27\", \"cardMask\": \"****-****-****-****-****-****-***\"}<\/code> to Base64, and pass the resulting string:<br \/>\n<code>\"SaleToAcquirerData\": \"eyJtYXhMZW5ndGgiOiAiMjciLCAiY2FyZE1hc2siOiAiKioqKi0qKioqLSoqKiotKioqKi0qKioqLSoqKiotKioqIn0=\"<\/code><\/p>\n<\/li>\n<li>\n<p>Option 2: a key-value pair:<br \/>\n<code>\"SaleToAcquirerData\": \"maxLength=27&amp;cardMask=****-****-****-****-****-****-***\"<\/code><\/p>\n<\/li>\n<\/ul>\n<p>The format that you use here will also be the format of the <code>AdditionalResponse<\/code> that you receive. If there are more tender options (for example, <span translate=\"no\"><strong>ReceiptHandler<\/strong><\/span> ) or other data elements that you need to pass in the <code>SaleToAcquirerData<\/code> field, refer to <a href=\"\/point-of-sale\/add-data\">Add information to a payment<\/a>.<br \/>\n<br><\/p>\n<\/li>\n<li>\n<p>The  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/terminal-api\/latest\/post\/payment#request-PaymentTransaction\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">PaymentTransaction<\/a> object with:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter<\/th>\n<th style=\"text-align: center;\">Required<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>AmountsReq<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">The <code>Currency<\/code> and <code>RequestedAmount<\/code> being refunded to the gift card.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<li>\n<p>The  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/terminal-api\/latest\/post\/payment#request-PaymentData\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">PaymentData<\/a> object with:<\/p>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Parameter<\/th>\n<th style=\"text-align: center;\">Required<\/th>\n<th style=\"text-align: left;\">Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\"><code>PaymentType<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>Refund<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>PaymentInstrumentData.PaymentInstrumentType<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\"><span translate=\"no\"><strong>StoredValue<\/strong><\/span><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\"><code>PaymentInstrumentData.StoredValueAccountID<\/code><\/td>\n<td style=\"text-align: center;\"><img title=\"-white_check_mark-\" alt=\"-white_check_mark-\" class=\"smileys\" src=\"\/user\/data\/smileys\/emoji\/white_check_mark.png\" \/><\/td>\n<td style=\"text-align: left;\">The gift card details: <ul><li markdown=\"1\"><code>StoredValueAccountType<\/code>: <span translate=\"no\"><strong>GiftCard<\/strong><\/span><\/li><li markdown=\"1\"><code>StoredValueProvider<\/code>: the gift card issuer: <span translate=\"no\"><strong>givex<\/strong><\/span>, <span translate=\"no\"><strong>svs<\/strong><\/span>, <span translate=\"no\"><strong>valuelink<\/strong><\/span>, or <strong><a href=\"\/payment-methods\/gift-cards#supported-gift-cards\">any Intersolve-supported card type<\/a><\/strong>.<\/li><li markdown=\"1\"><code>IdentificationType<\/code>: <span translate=\"no\"><strong>PAN<\/strong><\/span>.<\/li><li markdown=\"1\"><code>EntryMode<\/code>, <code>StoredValueID<\/code> and <code>ExpiryDate<\/code>: these parameters depend on the <a href=\"\/point-of-sale\/gift-cards-terminal-api#card-entry\">card entry method<\/a> you are using. See the following table.<\/li><\/ul><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table>\n<thead>\n<tr>\n<th style=\"text-align: left;\">Card entry<\/th>\n<th style=\"text-align: left;\">Parameters<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align: left;\">Scan<\/td>\n<td style=\"text-align: left;\"><ul><li markdown=\"1\"><code>EntryMode<\/code>: <span translate=\"no\"><strong>Scanned<\/strong><\/span><\/li><li markdown=\"1\"><code>StoredValueID<\/code>: gift card number.<\/li><li markdown=\"1\"><code>ExpiryDate<\/code>: expiry date of the gift card.<\/li><\/ul><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">Swipe<\/td>\n<td style=\"text-align: left;\"><ul><li markdown=\"1\"><code>EntryMode<\/code>: <span translate=\"no\"><strong>MagStripe<\/strong><\/span><\/li><li markdown=\"1\"><code>StoredValueID<\/code>: include this parameter but do not provide a value.<\/li><\/td>\n<\/tr>\n<tr>\n<td style=\"text-align: left;\">MKE<\/td>\n<td style=\"text-align: left;\"><ul><li markdown=\"1\"><code>EntryMode<\/code>: <span translate=\"no\"><strong>Keyed<\/strong><\/span><\/li><li markdown=\"1\"><code>StoredValueID<\/code>: include this parameter but do not provide a value.<\/li><\/ul><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/li>\n<\/ul>\n<p>The example below shows how to issue a refund of GBP&nbsp;30.00 to a scanned gift card.<\/p>\n<div data-component-wrapper=\"code-sample\">\n<code-sample :title=\"''\" :id=\"'refund-gift-cards_0'\" :code-data='[{\"language\":\"json\",\"tabTitle\":\"JSON\",\"content\":\"{\\n    \\\"SaleToPOIRequest\\\":{\\n        \\\"MessageHeader\\\":{\\n            \\\"ProtocolVersion\\\":\\\"3.0\\\",\\n            \\\"MessageClass\\\":\\\"Service\\\",\\n            \\\"MessageCategory\\\":\\\"Payment\\\",\\n            \\\"MessageType\\\":\\\"Request\\\",\\n            \\\"ServiceID\\\":\\\"9268\\\",\\n            \\\"SaleID\\\":\\\"POSSystem\\\",\\n            \\\"POIID\\\":\\\"V400m-324688179\\\"\\n        },\\n        \\\"PaymentRequest\\\":{\\n            \\\"SaleData\\\":{\\n                \\\"SaleTransactionID\\\":{\\n                    \\\"TransactionID\\\":\\\"44741\\\",\\n                    \\\"TimeStamp\\\":\\\"2019-06-22T12:20:27+00:00\\\"\\n                },\\n                \\\"SaleReferenceID\\\":\\\"YOUR_ORDER_REFERENCE\\\"\\n            },\\n            \\\"PaymentTransaction\\\":{\\n                \\\"AmountsReq\\\":{\\n                    \\\"Currency\\\":\\\"GBP\\\",\\n                    \\\"RequestedAmount\\\":30\\n                }\\n            },\\n            \\\"PaymentData\\\":{\\n                \\\"PaymentType\\\":\\\"Refund\\\",\\n                \\\"PaymentInstrumentData\\\":{\\n                    \\\"PaymentInstrumentType\\\":\\\"StoredValue\\\",\\n                    \\\"StoredValueAccountID\\\":{\\n                        \\\"StoredValueAccountType\\\":\\\"GiftCard\\\",\\n                        \\\"StoredValueProvider\\\":\\\"svs\\\",\\n                        \\\"IdentificationType\\\":\\\"PAN\\\",\\n                        \\\"EntryMode\\\":[\\n                            \\\"Scanned\\\"\\n                        ],\\n                        \\\"StoredValueID\\\":\\\"6006491260550218066\\\",\\n                        \\\"ExpiryDate\\\":\\\"1122\\\"\\n                    }\\n                }\\n            }\\n        }\\n    }\\n}\"},{\"language\":\"java\",\"tabTitle\":\"Java\",\"content\":\"String serviceID = \\\"YOUR_UNIQUE_ATTEMPT_ID\\\";\\nString saleID = \\\"YOUR_CASH_REGISTER_ID\\\";\\nString POIID = \\\"YOUR_TERMINAL_ID\\\";\\nString transactionID = \\\"YOUR_UNIQUE_TRANSACTION_ID\\\";\\n\\nSaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest();\\nMessageHeader messageHeader = new MessageHeader();\\nmessageHeader.setProtocolVersion(\\\"3.0\\\");\\nmessageHeader.setMessageClass( MessageClassType.SERVICE );\\nmessageHeader.setMessageCategory( MessageCategoryType.PAYMENT );\\nmessageHeader.setMessageType( MessageType.REQUEST );\\nmessageHeader.setServiceID(serviceID);\\nmessageHeader.setSaleID(saleID);\\nmessageHeader.setPOIID(POIID);\\nsaleToPOIRequest.setMessageHeader(messageHeader);\\n\\nPaymentRequest paymentRequest = new PaymentRequest();\\nSaleData saleData = new SaleData();\\nTransactionIdentification saleTransactionID = new TransactionIdentification();\\nsaleTransactionID.setTransactionID(transactionID);\\nsaleTransactionID.setTimeStamp(DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar()));\\nsaleData.setSaleTransactionID(saleTransactionID);\\nsaleData.setSaleReferenceID(\\\"YOUR_ORDER_REFERENCE\\\");\\npaymentRequest.setSaleData(saleData);\\n\\nPaymentTransaction paymentTransaction = new PaymentTransaction();\\nAmountsReq amountsReq = new AmountsReq();\\namountsReq.setCurrency(\\\"GBP\\\");\\namountsReq.setRequestedAmount( BigDecimal.valueOf(30) );\\npaymentTransaction.setAmountsReq(amountsReq);\\npaymentRequest.setPaymentTransaction(paymentTransaction);\\n\\nPaymentData paymentData = new PaymentData();\\npaymentData.setPaymentType( PaymentType.REFUND );\\nPaymentInstrumentData paymentInstrumentData = new PaymentInstrumentData();\\npaymentInstrumentData.setPaymentInstrumentType( PaymentInstrumentType.STORED_VALUE );\\nStoredValueAccountID storedValueAccountID = new StoredValueAccountID();\\nstoredValueAccountID.setStoredValueAccountType( StoredValueAccountType.GIFT_CARD );\\nstoredValueAccountID.setStoredValueProvider(\\\"svs\\\");\\nstoredValueAccountID.setIdentificationType( IdentificationType.PAN );\\nstoredValueAccountID.getEntryMode().add( EntryModeType.SCANNED );\\nstoredValueAccountID.setStoredValueID(\\\"6006491260550218066\\\");\\nstoredValueAccountID.setExpiryDate(\\\"1122\\\");\\npaymentInstrumentData.setStoredValueAccountID(storedValueAccountID);\\npaymentData.setPaymentInstrumentData(paymentInstrumentData);\\npaymentRequest.setPaymentData(paymentData);\\nsaleToPOIRequest.setPaymentRequest(paymentRequest);\\nterminalAPIRequest.setSaleToPOIRequest(saleToPOIRequest);\"}]' :enable-copy-link-to-code-block=\"true\" :code-sample-card-size=\"'fullsize'\"><\/code-sample>\n<\/div>\n<\/li>\n<li>\n<p>In the  <a href=\"https:\/\/docs.adyen.com\/api-explorer\/terminal-api\/latest\/post\/payment#responses-200\" class=\"codeLabel  external-link no-image\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">PaymentResponse<\/a>, check the following:<\/p>\n<ul>\n<li><code>POIData.POITransactionID.TransactionID<\/code>: The <a href=\"\/point-of-sale\/design-your-integration\/terminal-api#transaction-identifier\">transaction identifier<\/a> for the refund.<\/li>\n<li><code>PaymentReceipt<\/code>: An object containing data you can use to <a href=\"\/point-of-sale\/basic-tapi-integration\/generate-receipts\">generate a receipt<\/a>.<\/li>\n<li><code>Response.Result<\/code>: <span translate=\"no\"><strong>Success<\/strong><\/span><\/li>\n<\/ul>\n<p>The example below indicates that the refund of GBP&nbsp;30.00 was successfully issued to the gift card.<\/p>\n<pre><code class=\"language-json\">{\n    \"SaleToPOIResponse\":{\n        \"PaymentResponse\":{\n            \"POIData\":{\n                \"POITransactionID\":{\n                    \"TimeStamp\":\"2019-06-22T12:20:31.000Z\",\n                    \"TransactionID\":\"u6W7001529670031000.NC6HT9CRT65ZGN82\"\n                }\n            },\n            \"SaleData\":{\n                \"SaleTransactionID\":{\n                    \"TimeStamp\":\"2019-06-22T12:20:27.000Z\",\n                    \"TransactionID\":\"44741\"\n                },\n                \"SaleReferenceID\":\"SalesRefABC\"\n            },\n            \"PaymentReceipt\":[...],\n            \"PaymentResult\":{\n                \"PaymentAcquirerData\":{\n                    \"AcquirerPOIID\":\"V400m-324688179\",\n                    \"AcquirerTransactionID\":{\n                        \"TimeStamp\":\"2019-06-22T12:20:31.000Z\",\n                        \"TransactionID\":\"NC6HT9CRT65ZGN82\"\n                    },\n                    \"MerchantID\":\"TestMerchantPOS\"\n                },\n                \"PaymentInstrumentData\":{\n                    \"StoredValueAccountID\":{\n                        \"IdentificationType\":\"PAN\",\n                        \"EntryMode\":[\n                            \"MagStripe\"\n                        ],\n                        \"StoredValueID\":\"603628173862001915498\",\n                        \"StoredValueAccountType\":\"GiftCard\",\n                        \"StoredValueProvider\":\"givex\",\n                        \"ExpiryDate\":\"1249\"\n                    },\n                    \"PaymentInstrumentType\":\"StoredValue\"\n                },\n                \"AmountsResp\":{\n                    \"AuthorizedAmount\":30.00,\n                    \"Currency\":\"GBP\"\n                },\n                \"PaymentType\":\"Refund\"\n            },\n            \"Response\":{\n                \"Result\":\"Success\",\n                \"AdditionalResponse\":\"...\"\n            }\n        },\n        \"MessageHeader\":{\n            \"ProtocolVersion\":\"3.0\",\n            \"SaleID\":\"POSSystem\",\n            \"MessageClass\":\"Service\",\n            \"MessageCategory\":\"Payment\",\n            \"ServiceID\":\"9268\",\n            \"POIID\":\"V400m-324688179\",\n            \"MessageType\":\"Response\"\n        }\n    }\n}<\/code><\/pre>\n<\/li>\n<\/ol>\n<h2 id=\"see-also\">See also<\/h2>\n<div class=\"see-also-links output-inline\" id=\"see-also\">\n<ul><li><a href=\"\/point-of-sale\/gift-cards-terminal-api\/activate\"\n                        target=\"_self\"\n                        >\n                    Activate a gift card\n                <\/a><\/li><li><a href=\"\/point-of-sale\/gift-cards-terminal-api\/query-the-balance\"\n                        target=\"_self\"\n                        >\n                    Check the balance of a gift card\n                <\/a><\/li><li><a href=\"\/point-of-sale\/gift-cards-terminal-api\/deactivate\"\n                        target=\"_self\"\n                        >\n                    Deactivate a gift card\n                <\/a><\/li><li><a href=\"\/point-of-sale\/basic-tapi-integration\/refund-payment\/referenced\"\n                        target=\"_self\"\n                        >\n                    Referenced refund\n                <\/a><\/li><\/ul><\/div>\n","url":"https:\/\/docs.adyen.com\/point-of-sale\/alternative-payment-methods\/gift-cards-terminal-api\/refund-gift-cards","articleFields":{"description":"Make a referenced refund if you have the original payment data, or an unreferenced refund if you do not.","id":"39952811","type":"page","_expandable":{"operations":""},"status":"current","last_edit_on":"14-11-2019 11:17"},"algolia":{"url":"https:\/\/docs.adyen.com\/point-of-sale\/alternative-payment-methods\/gift-cards-terminal-api\/refund-gift-cards","title":"Make a refund to a gift card","content":"If you want to return funds to a shopper's gift card, you can make a referenced refund or an unreferenced refund:\n\n\nReferenced refund: a ReversalRequest with a reference to the original payment's transaction identifier. Use this if you want to refund a payment made with this gift card. The transaction identifier references the gift card details, so you do not need to specify them in the refund request. You can also make (multiple) partial refunds in this way. For the detailed steps, refer to Referenced refund.\n\n\nUnreferenced refund: a PaymentRequest with PaymentType 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. Because an unreferenced refund to a gift card requires specifying the gift card details, we explain this transaction on this page.\n\n\n\nIf you want to give the balance of a gift card to a shopper in cash, you should make a cashback request instead.\n\nRequirements\nBefore you begin, take into account the following requirements, limitations, and preparations.\n\n\n\nRequirement\nDescription\n\n\n\n\nIntegration type\nA Terminal API integration with payment terminals.\n\n\nSetup steps\nBefore you begin: Add the payment method to your Adyen account.Complete the onboarding process with the gift card provider.\n\n\n\nMake an unreferenced refund\nTo issue a refund to a gift card:\n\n\nDetermine the card entry method:\n\nIf you want to scan the card, do that first and use the obtained card details in your request.\nIf 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.\n\n\n\nMake a payment request, specifying:\n\n\nThe standard \n  SaleToPOIRequest.MessageHeader\n object, with MessageClass set to Service and MessageCategory set to Payment.\n\n\n\nParameter\nRequired\nDescription\n\n\n\n\nProtocolVersion\n\n3.0\n\n\nMessageClass\n\nService\n\n\nMessageCategory\n\nPayment\n\n\nMessageType\n\nRequest\n\n\nServiceID\n\nYour 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.\n\n\nSaleID\n\nYour unique ID for the POS system component to send this request from.\n\n\nPOIID\n\nThe unique ID of the terminal to send this request to. Format: [device model]-[serial number].\n\n\n\n\n\n\n\nThe  PaymentRequest.SaleData object with:\n\n\n\nParameter\nRequired\nDescription\n\n\n\n\nSaleTransactionID.TransactionID\n\nYour reference to identify this refund.\n\n\nSaleTransactionID.TimeStamp\n\nDate and time of the request, in UTC format.\n\n\nSaleReferenceID\n\nYour 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.\n\n\nSaleToAcquirerData\n\nOptional 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.\n\n\n\n\nIn SaleData.SaleToAcquirerData, specify the parameter in one of the following formats:\n\n\nOption 1: a JSON object converted to a Base64 encoded string.\nEncode {\"maxLength\": \"27\", \"cardMask\": \"****-****-****-****-****-****-***\"} to Base64, and pass the resulting string:\n\"SaleToAcquirerData\": \"eyJtYXhMZW5ndGgiOiAiMjciLCAiY2FyZE1hc2siOiAiKioqKi0qKioqLSoqKiotKioqKi0qKioqLSoqKiotKioqIn0=\"\n\n\nOption 2: a key-value pair:\n\"SaleToAcquirerData\": \"maxLength=27&amp;cardMask=****-****-****-****-****-****-***\"\n\n\nThe 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 the SaleToAcquirerData field, refer to Add information to a payment.\n\n\n\nThe  PaymentTransaction object with:\n\n\n\nParameter\nRequired\nDescription\n\n\n\n\nAmountsReq\n\nThe Currency and RequestedAmount being refunded to the gift card.\n\n\n\n\n\nThe  PaymentData object with:\n\n\n\nParameter\nRequired\nDescription\n\n\n\n\nPaymentType\n\nRefund\n\n\nPaymentInstrumentData.PaymentInstrumentType\n\nStoredValue\n\n\nPaymentInstrumentData.StoredValueAccountID\n\nThe gift card details: StoredValueAccountType: GiftCardStoredValueProvider: the gift card issuer: givex, svs, valuelink, or any Intersolve-supported card type.IdentificationType: PAN.EntryMode, StoredValueID and ExpiryDate: these parameters depend on the card entry method you are using. See the following table.\n\n\n\n\n\n\nCard entry\nParameters\n\n\n\n\nScan\nEntryMode: ScannedStoredValueID: gift card number.ExpiryDate: expiry date of the gift card.\n\n\nSwipe\nEntryMode: MagStripeStoredValueID: include this parameter but do not provide a value.\n\n\nMKE\nEntryMode: KeyedStoredValueID: include this parameter but do not provide a value.\n\n\n\n\n\nThe example below shows how to issue a refund of GBP&nbsp;30.00 to a scanned gift card.\n\n\n\n\n\nIn the  PaymentResponse, check the following:\n\nPOIData.POITransactionID.TransactionID: The transaction identifier for the refund.\nPaymentReceipt: An object containing data you can use to generate a receipt.\nResponse.Result: Success\n\nThe example below indicates that the refund of GBP&nbsp;30.00 was successfully issued to the gift card.\n{\n    \"SaleToPOIResponse\":{\n        \"PaymentResponse\":{\n            \"POIData\":{\n                \"POITransactionID\":{\n                    \"TimeStamp\":\"2019-06-22T12:20:31.000Z\",\n                    \"TransactionID\":\"u6W7001529670031000.NC6HT9CRT65ZGN82\"\n                }\n            },\n            \"SaleData\":{\n                \"SaleTransactionID\":{\n                    \"TimeStamp\":\"2019-06-22T12:20:27.000Z\",\n                    \"TransactionID\":\"44741\"\n                },\n                \"SaleReferenceID\":\"SalesRefABC\"\n            },\n            \"PaymentReceipt\":[...],\n            \"PaymentResult\":{\n                \"PaymentAcquirerData\":{\n                    \"AcquirerPOIID\":\"V400m-324688179\",\n                    \"AcquirerTransactionID\":{\n                        \"TimeStamp\":\"2019-06-22T12:20:31.000Z\",\n                        \"TransactionID\":\"NC6HT9CRT65ZGN82\"\n                    },\n                    \"MerchantID\":\"TestMerchantPOS\"\n                },\n                \"PaymentInstrumentData\":{\n                    \"StoredValueAccountID\":{\n                        \"IdentificationType\":\"PAN\",\n                        \"EntryMode\":[\n                            \"MagStripe\"\n                        ],\n                        \"StoredValueID\":\"603628173862001915498\",\n                        \"StoredValueAccountType\":\"GiftCard\",\n                        \"StoredValueProvider\":\"givex\",\n                        \"ExpiryDate\":\"1249\"\n                    },\n                    \"PaymentInstrumentType\":\"StoredValue\"\n                },\n                \"AmountsResp\":{\n                    \"AuthorizedAmount\":30.00,\n                    \"Currency\":\"GBP\"\n                },\n                \"PaymentType\":\"Refund\"\n            },\n            \"Response\":{\n                \"Result\":\"Success\",\n                \"AdditionalResponse\":\"...\"\n            }\n        },\n        \"MessageHeader\":{\n            \"ProtocolVersion\":\"3.0\",\n            \"SaleID\":\"POSSystem\",\n            \"MessageClass\":\"Service\",\n            \"MessageCategory\":\"Payment\",\n            \"ServiceID\":\"9268\",\n            \"POIID\":\"V400m-324688179\",\n            \"MessageType\":\"Response\"\n        }\n    }\n}\n\n\nSee also\n\n\n                    Activate a gift card\n                \n                    Check the balance of a gift card\n                \n                    Deactivate a gift card\n                \n                    Referenced refund\n                \n","type":"page","locale":"en","boost":16,"hierarchy":{"lvl0":"Home","lvl1":"In-person payments","lvl2":"Alternative payment methods","lvl3":"Gift cards and other stored value cards","lvl4":"Make a refund to a gift card"},"hierarchy_url":{"lvl0":"https:\/\/docs.adyen.com\/","lvl1":"https:\/\/docs.adyen.com\/point-of-sale","lvl2":"https:\/\/docs.adyen.com\/point-of-sale\/alternative-payment-methods","lvl3":"https:\/\/docs.adyen.com\/point-of-sale\/alternative-payment-methods\/gift-cards-terminal-api","lvl4":"\/point-of-sale\/alternative-payment-methods\/gift-cards-terminal-api\/refund-gift-cards"},"levels":5,"category":"In-person payments","category_color":"green","tags":["refund"]},"articleFiles":{"refund-gift-cards_0.json":"<p alt=\"\">refund-gift-cards_0.json<\/p>"}}
