Deactivate

Outlines how to deactivate a gift card using the Terminal API.


Not all operations are available for each type of gift card. For an overview of supported features for the different types, see Gift Card Overview

Endpoint

The URL used to send  Terminal API  messages depends on your type of implementation. For more information on the architectures available, see the Terminal API Overview .

Request

Stored Value requests are used to deactivate a gift card. For a list of Stored Value Request fields, see StoredValueRequest fields.

The elements of a deactivate request are wrapped in a StoredValueRequest envelope.

The SaleID and ServiceID in the MessageHeader should be unique. SaleID and ServiceID combinations are rejected if used recently, within 48 hours.

The fields described below are the basic fields you specify when making a StoredValueRequest call to the Terminal API.

StoredValueRequest - Deactivate
{
  "SaleToPOIRequest": {
    "MessageHeader": {
      "ProtocolVersion": "3.0",
      "MessageClass": "Service",
      "MessageCategory": "StoredValue",
      "MessageType": "Request",
      "ServiceID": "0517161303",
      "SaleID": "POSSystemID12345",
      "POIID": "P400Plus-275008713"
    },
    "StoredValueRequest": {
      "SaleData": {
        "SaleTransactionID": {
          "TransactionID": "13098",
          "TimeStamp": "2018-05-17T14:13:03+00:00"
        }
      },
      "StoredValueData": [
        {
          "StoredValueTransactionType": "Unload",
          "StoredValueAccountID": {
            "StoredValueAccountType": "GiftCard",
            "StoredValueProvider": "givex",
            "ExpiryDate": "1117",
            "StoredValueID": "6006491260550218157",
            "EntryMode": [
              "MagStripe"
            ],
            "IdentificationType": "PAN"
          },
          "ItemAmount": 0,
          "Currency": "CAD"
        }
      ]
    }
  }
}

Response

For a list of Stored Value Response fields, see StoredValueResponse fields.

You receive a response with the following fields:

StoredValueResponse - Deactivate
{
  "SaleToPOIResponse": {
    "StoredValueResponse": {
      "POIData": {
        "POITransactionID": {
          "TimeStamp": "2018-05-17T14:13:03.000Z",
          "TransactionID": "oLkO001526566383000.9815265664093834"
        }
      },
      "SaleData": {
        "SaleTransactionID": {
          "TimeStamp": "2018-05-17T14:13:03.000Z",
          "TransactionID": "13098"
        }
      },
      "PaymentReceipt": [
        {
          "DocumentQualifier": "CashierReceipt",
          "OutputContent": {
            "OutputFormat": "Text",
            "OutputText": [
              {
                "CharacterStyle": "Bold",
                "Text": "name=Adyen&key=header1",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=www.adyen.com&key=header2",
                "EndOfLineFlag": true
              },
              {
                "Text": "key=filler",
                "EndOfLineFlag": true
              },
              {
                "CharacterStyle": "Bold",
                "Text": "name=MERCHANT%20COPY&key=merchantTitle",
                "EndOfLineFlag": true
              },
              {
                "Text": "key=filler",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Date&value=17%2f05%2f18&key=txdate",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Time&value=14%3a13%3a03&key=txtime",
                "EndOfLineFlag": true
              },
              {
                "Text": "key=filler",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Card&value=%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a5422&key=pan",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Pref.%20name&key=preferredName",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Card%20type&value=givex&key=cardType",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Payment%20method&value=givex&key=paymentMethod",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Payment%20variant&value=givex&key=paymentMethodVariant",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Entry%20mode&value=MSR&key=posEntryMode",
                "EndOfLineFlag": true
              },
              {
                "Text": "key=filler",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=MID&value=30458&key=mid",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=TID&value=P400Plus-275008713&key=tid",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=PTID&value=12000000&key=ptid",
                "EndOfLineFlag": true
              },
              {
                "Text": "key=filler",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=ATC&key=atc",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Tender&value=oLkO001526566383000&key=txRef",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Reference&value=13098&key=mref",
                "EndOfLineFlag": true
              },
              {
                "Text": "key=filler",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Type&value=GOODS_SERVICES&key=txtype",
                "EndOfLineFlag": true
              },
              {
                "CharacterStyle": "Bold",
                "Text": "name=TOTAL&value=CAD%200.00%20%20&key=totalAmount",
                "EndOfLineFlag": true
              },
              {
                "Text": "key=filler",
                "EndOfLineFlag": true
              },
              {
                "CharacterStyle": "Bold",
                "Text": "name=APPROVED&key=approved",
                "EndOfLineFlag": true
              },
              {
                "Text": "key=filler",
                "EndOfLineFlag": true
              },
              {
                "Text": "key=filler",
                "EndOfLineFlag": true
              }
            ]
          }
        },
        {
          "DocumentQualifier": "CustomerReceipt",
          "OutputContent": {
            "OutputFormat": "Text",
            "OutputText": [
              {
                "CharacterStyle": "Bold",
                "Text": "name=Adyen&key=header1",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=www.adyen.com&key=header2",
                "EndOfLineFlag": true
              },
              {
                "Text": "key=filler",
                "EndOfLineFlag": true
              },
              {
                "CharacterStyle": "Bold",
                "Text": "name=CARDHOLDER%20COPY&key=cardholderHeader",
                "EndOfLineFlag": true
              },
              {
                "Text": "key=filler",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Date&value=17%2f05%2f18&key=txdate",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Time&value=14%3a13%3a03&key=txtime",
                "EndOfLineFlag": true
              },
              {
                "Text": "key=filler",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Card&value=%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a%2a5422&key=pan",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Pref.%20name&key=preferredName",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Card%20type&value=givex&key=cardType",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Payment%20method&value=givex&key=paymentMethod",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Payment%20variant&value=givex&key=paymentMethodVariant",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Entry%20mode&value=MSR&key=posEntryMode",
                "EndOfLineFlag": true
              },
              {
                "Text": "key=filler",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=MID&value=%2a%2a%2a%2a%2a%2a%2a%2a%2a0458&key=mid",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=TID&value=P400Plus-275008713&key=tid",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=PTID&value=12000000&key=ptid",
                "EndOfLineFlag": true
              },
              {
                "Text": "key=filler",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=ATC&key=atc",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Tender&value=oLkO001526566383000&key=txRef",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Reference&value=13098&key=mref",
                "EndOfLineFlag": true
              },
              {
                "Text": "key=filler",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Type&value=GOODS_SERVICES&key=txtype",
                "EndOfLineFlag": true
              },
              {
                "CharacterStyle": "Bold",
                "Text": "name=TOTAL&value=CAD%200.00%20%20&key=totalAmount",
                "EndOfLineFlag": true
              },
              {
                "Text": "key=filler",
                "EndOfLineFlag": true
              },
              {
                "CharacterStyle": "Bold",
                "Text": "name=APPROVED&key=approved",
                "EndOfLineFlag": true
              },
              {
                "Text": "key=filler",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Please%20retain%20for%20your%20records&key=retain",
                "EndOfLineFlag": true
              },
              {
                "Text": "key=filler",
                "EndOfLineFlag": true
              },
              {
                "Text": "key=filler",
                "EndOfLineFlag": true
              },
              {
                "Text": "name=Thank%20you&key=thanks",
                "EndOfLineFlag": true
              }
            ]
          }
        }
      ],
      "StoredValueResult": [
        {
          "StoredValueTransactionType": "Unload",
          "ItemAmount": 0,
          "StoredValueAccountStatus": {
            "StoredValueAccountID": {
              "IdentificationType": "PAN",
              "EntryMode": [
                "MagStripe"
              ],
              "StoredValueID": "6006491260550218157",
              "StoredValueAccountType": "GiftCard",
              "ExpiryDate": "1117"
            },
            "CurrentBalance": 0
          },
          "Currency": "CAD"
        }
      ],
      "Response": {
        "Result": "Success",
        "AdditionalResponse": "tid=12000000&transactionType=GOODS_SERVICES&pspReference=9815265664093834&currentBalanceCurrency=CAD&offline=false&giftcardTrack2=603628646282001915422&mid=30458&note=Direct%20API%20REQUIRES%20payload%20crypto%20on%20live%2c%20cleartext%20allowed%20for%20testing%20only&giftcardPAN=603628646282001915422&currentBalanceValue=0"
      }
    },
    "MessageHeader": {
      "ProtocolVersion": "3.0",
      "SaleID": "POSSystemID12345",
      "MessageClass": "Service",
      "MessageCategory": "StoredValue",
      "ServiceID": "0517161303",
      "POIID": "P400Plus-275008713",
      "MessageType": "Response"
    }
  }
}

Not all data in a response will always be available. The availability of some data depends on an internet connection and the payment method used.