Tokenize shopper data for shopper recognition

Outlines using the terminal API to create a recurring contract by linking payment details to a shopper. 

Before you begin

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 .

Step 1: Tokenize details

To recognize a shopper later, you must first save their tokenized details by sending additional parameters in SaleToAcquirerData in the initial transaction. 

 In the example below, a PaymentRequest is used to create the card alias (an alias for the credit card number). This can also be done using a CardAcquisition request. For more information, see Acquire card details.   

These additional parameters are: 

Element

Details

recurringContract*

The type of recurring contract to be used.

Possible values:

  • ONECLICK – The shopper opts to store their card details for future use. 
    The shopper is present for the subsequent transaction, for cards the security code (CVC/CVV) is required.
  • RECURRING – Payment details are stored for future use. For cards, the security code (CVC/CVV) is not required for subsequent payments. 
    This is used for shopper not present transactions.
  • ONECLICK,RECURRING – Payment details are stored for future use. 
    This allows the use of the stored payment details regardless of whether the shopper is on your site or not.

Used only in combination with shopperEmail and shopperReference.

shopperEmail

The email of the shopper.
Only in combination with shopperReference, and recurringContract

shopperReference

A unique reference to the shopper as generated by the merchant. Only in combination with shopperEmail and recurringContract

 For more information on how additional data works, see Pass additional data

Request

Depending on the TokenRequestedType you pass, either a pspReference or cardAlias are returned:

  • If you pass TokenRequestedType set to Transaction it return the pspReference.
  • If you send in TokenRequestedType set to Customer it will return the cardAlias.
PaymentRequest
{
   "SaleToPOIRequest":{
      "MessageHeader":{
         "POIID":"MX925-286240330",
         "MessageClass":"Service",
         "MessageType":"Request",
         "ProtocolVersion":"3.0",
         "ServiceID":"1113162452",
         "SaleID":"POSSystemID12345",
         "MessageCategory":"Payment"
      },
      "PaymentRequest":{
         "PaymentTransaction":{
            "AmountsReq":{
               "RequestedAmount":10.99,
               "Currency":"EUR"
            },
            "TransactionConditions":{

            }
         },
         "SaleData":{
            "SaleToAcquirerData":"shopperEmail=hola@gmail.com&shopperReference=fakeRef&recurringContract=RECURRING",
            "TokenRequestedType":"Customer",
            "SaleTransactionID":{
               "TransactionID":"8377",
               "TimeStamp":"2017-11-13T15:24:52+00:00"
            }
         }
      }
   }
}


Response

For a list of PaymentResponse fields, see PaymentResponse fields.

An authorization is attempted and you receive a response with the following fields, including an AdditionalResponse:

PaymentResponse
{  
   "SaleToPOIResponse":{  
      "PaymentResponse":{  
         "Response":{  
            "AdditionalResponse":"applicationLabel=MCDCCFR&cardHolderVerificationMethodResults=440002&AID=A000000004101002&applicationPreferredName=mc%20f&tid=12000000&merchantReference=CardRemoval-AskDcc&tc=F2BCABD61478C117&txdate=10-11-2017&paymentMethod=mc&transactionReferenceNumber=8515103155990306&shopperReference=1231&transactionType=GOODS_SERVICES&cardType=mc&offline=false&cardScheme=mc&mid=51&txtime=13%3a06%3a16&shopperEmail=swag%40ill.com&cardHolderName=TC04_MC_Approved_DCC",
            "Result":"Success"
         },
         "PaymentResult":{  
            "PaymentAcquirerData":{  
               "AcquirerTransactionID":{  
                  "TransactionID":"8515103155990306",
                  "TimeStamp":"2017-11-10T12:06:16.000Z"
               },
               "MerchantID":"TestMerchantPOSRobot02",
               "AcquirerPOIID":"MX925-261078152"
            },
            "PaymentInstrumentData":{  
               "CardData":{  
                  "CardCountryCode":"840",
                  "EntryMode":[  
                     "ICC"
                  ],
                  "MaskedPan":"541333 **** 9990",
                  "PaymentBrand":"mc",
                  "SensitiveCardData":{  
                     "CardSeqNumb":"53",
                     "ExpiryDate":"0228"
                  }
               },
               "PaymentInstrumentType":"Card"
            },
            "AmountsResp":{  
               "AuthorizedAmount":300,
               "Currency":"EUR"
            }
         },
         "PaymentReceipt":[
            {
               "OutputContent":{
                  "OutputFormat":"Text",
                  "OutputText":[
                     {
                        "CharacterStyle":"Bold",
                        "EndOfLineFlag":true,
                        "Text":"key=header1&name=Adyen"
                     },
                   [...]
                     {
                        "EndOfLineFlag":true,
                        "Text":"key=filler"
                     }
                  ]
               },
               "DocumentQualifier":"CashierReceipt"
            },
            {
               "OutputContent":{
                  "OutputFormat":"Text",
                  "OutputText":[
                     {
                        "CharacterStyle":"Bold",
                        "EndOfLineFlag":true,
                        "Text":"key=header1&name=Adyen"
                     },
                   [...]
                     {
                        "EndOfLineFlag":true,
                        "Text":"key=filler"
                     },
                     {
                        "EndOfLineFlag":true,
                        "Text":"key=thanks&name=Thank%20you"
                     }
                  ]
               },
               "DocumentQualifier":"CustomerReceipt"
            }
         ],
         "POIData":{  
            "POITransactionID":{  
               "TransactionID":"oLkO001510315576349.8515103155990306",
               "TimeStamp":"2017-11-10T12:06:16.000Z"
            }
         },
         "SaleData":{  
            "SaleTransactionID":{  
               "TransactionID":"CardRemoval-AskDcc",
               "TimeStamp":"2017-11-10T12:05:58.686Z"
            }
         }
      },
      "MessageHeader":{  
         "SaleID":"POSSystemID12345",
         "ProtocolVersion":"3.0",
         "MessageType":"Response",
         "POIID":"MX925-261078152",
         "ServiceID":"885906155",
         "MessageClass":"Service",
         "MessageCategory":"Payment"
      }
   }
}

If you receive an error, use our Error Scenarios page to troubleshoot the issue.

Warnings are triggered when non-fatal errors occur and are returned in the response.

Step 2: Recognize the shopper

After a shopper's details have been saved, you can use these to recognize the shopper when they make a payment later