--- title: "Deactivate or cash out a gift card" description: "Disable or cash out a gift card at the point of sale." url: "https://docs.adyen.com/point-of-sale/alternative-payment-methods/gift-cards-terminal-api/deactivate" source_url: "https://docs.adyen.com/point-of-sale/alternative-payment-methods/gift-cards-terminal-api/deactivate.md" canonical: "https://docs.adyen.com/point-of-sale/alternative-payment-methods/gift-cards-terminal-api/deactivate" last_modified: "2019-10-01T17:32:00+02:00" language: "en" --- # Deactivate or cash out a gift card Disable or cash out a gift card at the point of sale. [View source](/point-of-sale/alternative-payment-methods/gift-cards-terminal-api/deactivate.md) When the balance of a gift card has gone below a certain amount or when you suspect fraud, you can stop further use of the card. You can: * Make a [cashback request](#cashing-back-gift-card) to take funds off the gift card and give this back to the shopper as cash. If you cash out the full remaining balance, the card is no longer active and cannot be used again. * Make a [deactivation request](#deactivate-gift-card) to disable the card without cashing it out. ## Requirements Before you begin, take into account the following requirements, limitations, and preparations. | Requirement | Description | | -------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | **Integration type** | A [Terminal API](/point-of-sale/design-your-integration/terminal-api) integration with payment terminals. | | **Limitations** | Deactivation is only supported for gift cards provided by Givex. | | **Setup steps** | Before you begin:- [Add the payment method to your Adyen account](/point-of-sale/what-we-support/payment-methods#add-payment-methods-to-your-account). - Complete the onboarding process with the gift card provider. | ## Cash back a gift card Your options with a cashback request depend on the gift card provider, the scheme rules, and the applicable law. If cashbacks are allowed, you can normally only cash out the full amount remaining on the card. But if the gift card was provided by Givex, it is possible in some cases to give a cashback for a partial amount. The funds taken off the gift card can be given back to the shopper in cash, or transferred to their credit or debit card by [making an unreferenced refund](/point-of-sale/gift-cards-terminal-api/refund-gift-cards#make-an-unreferenced-refund). To make a gift card cashback request: 1. Determine the [card entry method](/point-of-sale/gift-cards-terminal-api#card-entry): * 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. 2. [Check the balance](/point-of-sale/gift-cards-terminal-api/query-the-balance) remaining on the gift card. 3. [Make a payment request](/point-of-sale/basic-tapi-integration/make-a-payment), specifying: * The standard [`SaleToPOIRequest.MessageHeader` ](/point-of-sale/design-your-integration/terminal-api#request-message-header)object, with `MessageClass` set to **Service** and `MessageCategory` set to **Payment**. | Parameter | Required | Description | | ----------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | `ProtocolVersion` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **3.0** | | `MessageClass` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **Service** | | `MessageCategory` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **Payment** | | `MessageType` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **Request** | | `ServiceID` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | 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` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Your unique ID for the POS system component to send this request from. | | `POIID` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The unique ID of the terminal to send this request to. Format: *\[device model]-\[serial number]*. | - The [SaleData](https://docs.adyen.com/api-explorer/terminal-api/latest/post/payment#request-SaleData) object with: | Parameter | Required | Description | | --------------------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `SaleTransactionID.TransactionID` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Your reference to identify this cashback request. We recommend using a unique value. | | `SaleTransactionID.TimeStamp` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Date and time of the cashback request, in [UTC format](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_\(UTC\)). | | `SaleReferenceID` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Optional parameter to provide your order number. You can use this to connect different gift card transactions to the same order. In the [Customer Area](https://ca-test.adyen.com/), it will appear as the **Merchant Order** for the transaction. | | `SaleToAcquirerData` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **redemptionType=cashback** | []()\ In `SaleData.SaleToAcquirerData`, specify the tender option in one of the following formats: * Option 1: a JSON object converted to a Base64 encoded string.\ Encode `{"redemptionType": "cashback"}` to Base64, and pass the resulting string:\ `"SaleToAcquirerData": "eyJyZWRlbXB0aW9uVHlwZSI6ICJjYXNoYmFjayJ9"` * Option 2: a key-value pair:\ `"SaleToAcquirerData": "redemptionType=cashback"` 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 the `SaleToAcquirerData` field, refer to [Add information to a payment](/point-of-sale/add-data). - The [PaymentTransaction](https://docs.adyen.com/api-explorer/terminal-api/latest/post/payment#request-PaymentTransaction) object with: | Parameter | Required | Description | | ------------ | ------------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | | `AmountsReq` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The `Currency` and `RequestedAmount` being given back to the shopper. | - The [PaymentData](https://docs.adyen.com/api-explorer/terminal-api/latest/post/payment#request-PaymentData) object with: | Parameter | Required | Description | | --------------------------------------------- | ------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | `PaymentType` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **Normal** | | `PaymentInstrumentData.PaymentInstrumentType` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **StoredValue** | | `PaymentInstrumentData.StoredValueAccountID` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The gift card details:- `StoredValueAccountType`: **GiftCard** - `StoredValueProvider`: the gift card issuer: **givex**, **svs**, **valuelink**, or **[any Intersolve-supported card type](/payment-methods/gift-cards#supported-gift-cards)**. - `IdentificationType`: **PAN** - `EntryMode`, `StoredValueID` and `ExpiryDate`: these parameters depend on the [card entry method](/point-of-sale/gift-cards-terminal-api#card-entry) you are using. See the table below. | | Card entry | Parameters | | ---------- | ------------------------------------------------------------------------------------------------------------- | | Scan | * `EntryMode`: **Scanned** * `StoredValueID`: gift card number. * `ExpiryDate`: expiry date of the gift card. | | Swipe | - `EntryMode`: **MagStripe** - `StoredValueID`: include this parameter but do not provide a value. | | MKE | * `EntryMode`: **Keyed** * `StoredValueID`: include this parameter but do not provide a value. | The example below shows how to initiate a GBP 4.50 cashback request for a scanned gift card. #### JSON ```json { "SaleToPOIRequest": { "MessageHeader": { "ProtocolVersion": "3.0", "MessageClass": "Service", "MessageCategory": "Payment", "MessageType": "Request", "ServiceID": "9269", "SaleID": "POSTerminal", "POIID": "V400m-324688179" }, "PaymentRequest": { "SaleData": { "SaleTransactionID": { "TransactionID": "44750", "TimeStamp": "2019-06-22T12:55:20+00:00" }, "SaleReferenceID": "YOUR_ORDER_REFERENCE", "SaleToAcquirerData": "redemptionType=cashback" }, "PaymentTransaction": { "AmountsReq": { "Currency": "GBP", "RequestedAmount": 4.50 } }, "PaymentData": { "PaymentType": "Normal", "PaymentInstrumentData": { "PaymentInstrumentType": "StoredValue", "StoredValueAccountID": { "StoredValueAccountType": "GiftCard", "StoredValueProvider": "svs", "IdentificationType": "PAN", "EntryMode": [ "Scanned ], "StoredValueID": "6006491260550218066", "ExpiryDate": "1122" } } } } } } ``` #### Java ```java String serviceID = "YOUR_UNIQUE_ATTEMPT_ID"; String saleID = "YOUR_CASH_REGISTER_ID"; String POIID = "YOUR_TERMINAL_ID"; String transactionID = "YOUR_UNIQUE_TRANSACTION_ID"; SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest(); MessageHeader messageHeader = new MessageHeader(); messageHeader.setProtocolVersion("3.0"); messageHeader.setMessageClass( MessageClassType.SERVICE ); messageHeader.setMessageCategory( MessageCategoryType.PAYMENT ); messageHeader.setMessageType( MessageType.REQUEST ); messageHeader.setServiceID(serviceID); messageHeader.setSaleID(saleID); messageHeader.setPOIID(POIID); saleToPOIRequest.setMessageHeader(messageHeader); PaymentRequest paymentRequest = new PaymentRequest(); SaleData saleData = new SaleData(); TransactionIdentification saleTransactionID = new TransactionIdentification(); saleTransactionID.setTransactionID(transactionID); saleTransactionID.setTimeStamp(DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar())); saleData.setSaleTransactionID(saleTransactionID); saleData.setSaleReferenceID("YOUR_ORDER_REFERENCE"); saleData.setSaleToAcquirerData("redemptionType=cashback"); paymentRequest.setSaleData(saleData); PaymentTransaction paymentTransaction = new PaymentTransaction(); AmountsReq amountsReq = new AmountsReq(); amountsReq.setCurrency("GBP"); amountsReq.setRequestedAmount( BigDecimal.valueOf(4.50) ); paymentTransaction.setAmountsReq(amountsReq); paymentRequest.setPaymentTransaction(paymentTransaction); PaymentData paymentData = new PaymentData(); paymentData.setPaymentType( PaymentType.NORMAL ); PaymentInstrumentData paymentInstrumentData = new PaymentInstrumentData(); paymentInstrumentData.setPaymentInstrumentType( PaymentInstrumentType.STORED_VALUE ); StoredValueAccountID storedValueAccountID = new StoredValueAccountID(); storedValueAccountID.setStoredValueAccountType( StoredValueAccountType.GIFT_CARD ); storedValueAccountID.setStoredValueProvider("svs"); storedValueAccountID.setIdentificationType( IdentificationType.PAN ); storedValueAccountID.getEntryMode().add( EntryModeType.SCANNED ); storedValueAccountID.setStoredValueID("6006491260550218066"); storedValueAccountID.setExpiryDate("1122"); paymentInstrumentData.setStoredValueAccountID(storedValueAccountID); paymentData.setPaymentInstrumentData(paymentInstrumentData); paymentRequest.setPaymentData(paymentData); saleToPOIRequest.setPaymentRequest(paymentRequest); terminalAPIRequest.setSaleToPOIRequest(saleToPOIRequest); ``` The cashback request is sent to the Adyen payments platform for processing. Once processed, your integration receives the cashback result. 4. In the [PaymentResponse](https://docs.adyen.com/api-explorer/terminal-api/latest/post/payment#responses-200), check the following: * `POIData.POITransactionID.TransactionID`: The [transaction identifier](/point-of-sale/design-your-integration/terminal-api#transaction-identifier) for the cashback. * `PaymentReceipt`: An object containing data you can use to [generate a receipt](/point-of-sale/basic-tapi-integration/generate-receipts). * `Response.Result`: **Success** The example below indicates that the cashback request was successful, and GBP 4.50 was removed from the balance of the gift card. ```json { "SaleToPOIResponse":{ "PaymentResponse":{ "POIData":{ "POITransactionID":{ "TimeStamp":"2019-06-22T12:55:24.000Z", "TransactionID":"u6W7001529672124004.NC6HT9CRT65ZGN82" } }, "SaleData":{ "SaleTransactionID":{ "TimeStamp":"2019-06-22T12:55:20.000Z", "TransactionID":"44742" }, "SaleReferenceID":"YOUR_ORDER_REFERENCE" }, "PaymentReceipt":[...], "PaymentResult":{ "PaymentAcquirerData":{ "AcquirerPOIID":"V400m-324688179", "AcquirerTransactionID":{ "TimeStamp":"2019-06-22T12:55:24.000Z", "TransactionID":"NC6HT9CRT65ZGN82" }, "MerchantID":"TestMerchantPOS" }, "PaymentInstrumentData":{ "StoredValueAccountID":{ "IdentificationType":"PAN", "EntryMode":[ "MagStripe" ], "StoredValueID":"9826150911219687", "StoredValueAccountType":"GiftCard", "StoredValueProvider":"svs", "ExpiryDate":"1122" }, "PaymentInstrumentType":"StoredValue" }, "AmountsResp":{ "AuthorizedAmount":4.50, "Currency":"GBP" }, "PaymentType":"Normal" }, "Response":{ "Result":"Success", "AdditionalResponse":"..." } }, "MessageHeader":{ "ProtocolVersion":"3.0", "SaleID":"POSTerminal", "MessageClass":"Service", "MessageCategory":"Payment", "ServiceID":"9269", "POIID":"V400m-324688179", "MessageType":"Response" } } } ``` ## Deactivate a gift card If the gift card was issued by Givex, you can make a deactivation request to disable the card. To make a deactivation request: 1. Determine the [card entry method](/point-of-sale/gift-cards-terminal-api#card-entry): * 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. 2. Make a [Terminal API](/point-of-sale/design-your-integration/terminal-api) stored value request, specifying: * The standard [`SaleToPOIRequest.MessageHeader` ](/point-of-sale/design-your-integration/terminal-api#request-message-header)object, with `MessageClass` set to **Service** and `MessageCategory` set to **StoredValue**. | Parameter | Required | Description | | ----------------- | ------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | | `ProtocolVersion` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **3.0** | | `MessageClass` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **Service** | | `MessageCategory` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **StoredValue** | | `MessageType` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | **Request** | | `ServiceID` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | 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` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Your unique ID for the POS system component to send this request from. | | `POIID` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | The unique ID of the terminal to send this request to. Format: *\[device model]-\[serial number]*. | - The [StoredValueRequest.SaleData](https://docs.adyen.com/api-explorer/terminal-api/latest/post/storedvalue#request-SaleData) object with: | Parameter | Required | Description | | --------------------------------- | ------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------- | | `SaleTransactionID.TransactionID` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Your reference to identify this deactivation request. We recommend using a unique value. | | `SaleTransactionID.TimeStamp` | ![-white\_check\_mark-](/user/data/smileys/emoji/white_check_mark.png "-white_check_mark-") | Date and time of the request, in [UTC format](https://en.wikipedia.org/wiki/ISO_8601#Coordinated_Universal_Time_\(UTC\)). | - The [StoredValueRequest.StoredValueData](https://docs.adyen.com/api-explorer/terminal-api/latest/post/storedvalue#request-StoredValueData) object with: | Parameter | Required | Description | | ---------------------------------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | `StoredValueTransactionType` | | **Unload** | | `StoredValue.StoredValueAccountID` | | The gift card details:- `StoredValueAccountType`: **GiftCard** - `StoredValueProvider`: the gift card issuer: **givex**, **svs**, or **valuelink**. - `IdentificationType`: **PAN** - `ItemAmount`: **0** - `Currency`: currency of the gift card. - `EntryMode`, `StoredValueID` and `ExpiryDate`: these parameters depend on the [card entry method](/point-of-sale/gift-cards-terminal-api#card-entry) you are using. | | Card entry | Parameters | | ---------- | ------------------------------------------------------------------------------------------------------------- | | Scan | * `EntryMode`: **Scanned** * `StoredValueID`: gift card number. * `ExpiryDate`: expiry date of the gift card. | | Swipe | - `EntryMode`: **MagStripe** | | MKE | * `EntryMode`: **Keyed** * `StoredValueID`: **xxxxxxxxxxxxxxxxxxx**. | The example below shows how to deactivate of a scanned gift card. #### JSON ```json { "SaleToPOIRequest": { "MessageHeader": { "ProtocolVersion": "3.0", "MessageClass": "Service", "MessageCategory": "StoredValue", "MessageType": "Request", "ServiceID": "9270", "SaleID": "POSSystemID12345", "POIID": "P400Plus-275008713" }, "StoredValueRequest": { "SaleData": { "SaleTransactionID": { "TransactionID": "44743", "TimeStamp": "2019-05-17T14:13:03+00:00" } }, "StoredValueData": [ { "StoredValueTransactionType": "Unload", "StoredValueAccountID": { "StoredValueAccountType": "GiftCard", "StoredValueProvider": "givex", "IdentificationType": "PAN", "EntryMode": [ "Scanned" ], "StoredValueID": "6006491260550218066", "ExpiryDate": "1122" }, "ItemAmount": 0, "Currency": "GBP" } ] } } } ``` #### Java ```java String serviceID = "YOUR_UNIQUE_ATTEMPT_ID"; String saleID = "YOUR_CASH_REGISTER_ID"; String POIID = "YOUR_TERMINAL_ID"; String transactionID = "YOUR_UNIQUE_TRANSACTION_ID"; SaleToPOIRequest saleToPOIRequest = new SaleToPOIRequest(); MessageHeader messageHeader = new MessageHeader(); messageHeader.setProtocolVersion("3.0"); messageHeader.setMessageClass( MessageClassType.SERVICE ); messageHeader.setMessageCategory( MessageCategoryType.STORED_VALUE ); messageHeader.setMessageType( MessageType.REQUEST ); messageHeader.setServiceID(serviceID); messageHeader.setSaleID(saleID); messageHeader.setPOIID(POIID); saleToPOIRequest.setMessageHeader(messageHeader); StoredValueRequest storedValueRequest = new StoredValueRequest(); SaleData saleData = new SaleData(); TransactionIdentification saleTransactionID = new TransactionIdentification(); saleTransactionID.setTransactionID(transactionID); saleTransactionID.setTimeStamp(DatatypeFactory.newInstance().newXMLGregorianCalendar(new GregorianCalendar())); saleData.setSaleTransactionID(saleTransactionID); storedValueRequest.setSaleData(saleData); StoredValueData storedValueData = new StoredValueData(); storedValueData.setStoredValueTransactionType( StoredValueTransactionType.UNLOAD ); StoredValueAccountID storedValueAccountID = new StoredValueAccountID(); storedValueAccountID.setStoredValueAccountType( StoredValueAccountType.GIFT_CARD ); storedValueAccountID.setStoredValueProvider("givex"); storedValueAccountID.setIdentificationType( IdentificationType.PAN ); storedValueAccountID.getEntryMode().add( EntryModeType.SCANNED ); storedValueAccountID.setStoredValueID("6006491260550218066"); storedValueAccountID.setExpiryDate("1122"); storedValueData.setStoredValueAccountID(storedValueAccountID); storedValueData.setItemAmount( BigDecimal.valueOf(0) ); storedValueData.setCurrency("GBP"); storedValueRequest.setStoredValueData(storedValueData); saleToPOIRequest.setStoredValueRequest(storedValueRequest); terminalAPIRequest.setSaleToPOIRequest(saleToPOIRequest); ``` 3. In the [StoredValueResponse](https://docs.adyen.com/api-explorer/terminal-api/latest/post/storedvalue#responses-200-Response), check the following: * `POIData.POITransactionID.TransactionID`: The [transaction identifier](/point-of-sale/design-your-integration/terminal-api#transaction-identifier) for the deactivation. * `StoredValueResult.StoredValueTransactionType`: **Unload** and `Response.Result`: **Success** indicate that funds were loaded. * `StoredValueAccountStatus.CurrentBalance`: The current balance on the gift card, which is **0** because the card was deactivated. The example below indicates that the deactivation request was successful, and card **6006491260550218157** was deactivated. This card now has a balance of GBP 0. ```json { "SaleToPOIResponse":{ "StoredValueResponse":{ "POIData":{ "POITransactionID":{ "TimeStamp":"2019-05-17T14:13:03.000Z", "TransactionID":"oLkO001526566383000.KHQC5N7G84BLNK43" } }, ... "StoredValueResult":[ { "StoredValueTransactionType":"Unload", "ItemAmount":0, "StoredValueAccountStatus":{ "StoredValueAccountID":{ "IdentificationType":"PAN", "EntryMode":[ "MagStripe" ], "StoredValueID":"6006491260550218157", "StoredValueAccountType":"GiftCard", "ExpiryDate":"1122" }, "CurrentBalance":0 }, "Currency":"GBP" } ], "Response":{ "Result":"Success", "AdditionalResponse":"..." } }, "MessageHeader":{ "ProtocolVersion":"3.0", "SaleID":"POSSystemID12345", "MessageClass":"Service", "MessageCategory":"StoredValue", "ServiceID":"9270", "POIID":"V400m-324688179", "MessageType":"Response" } } } ``` ## See also * [Gift cards and other stored value cards](/point-of-sale/gift-cards-terminal-api) * [Activate a gift card](/point-of-sale/gift-cards-terminal-api/activate) * [Check the balance of a gift card](/point-of-sale/gift-cards-terminal-api/load-a-balance)