Search

Are you looking for test card numbers?

Would you like to contact support?

Default icon

Creating customer profiles

Create a profile for your customers, both online and in-store.

Before you are able to recognize a customer, you need to create a profile for them in your Customer Relationship Management System (CRM) or other database. Each customer profile should include identifiers that you will also receive in API responses:

  • Card alias: A value that uniquely represents the shopper's card number (PAN), for example A37317672402294. With this, you can recognize the card that a shopper is using. You can't use the card alias for making payments. For NFC wallet transactions, there's no card alias because the PAN is not available.
  • Payment Account Reference (PAR) (only Visa and MasterCard): The PAR is an identifier behind the card or digital wallet. It solves the issue with the PAN not being available for NFC wallet transactions. The PAR is currently being rolled out by Visa and Mastercard and therefore does not yet have full coverage.
  • Shopper reference: A unique reference defined by you and stored on the Adyen payments platform when creating a recurring contract. Based on the shopper reference, you can recognize the shopper who makes a purchase. If you collect the shopper's email address, you can link multiple card aliases and recurring detail references to the same shopper through their email address.
  • Shopper email: The shopper's email address that you collected in some way, and stored on the Adyen payments platform when creating a recurring contract.

You should always ask for your customer's consent before storing their personal information or tokenizing their card. See Data privacy.

Enable receiving identifiers

Proceed as follows to ensure the API responses that you receive from us contain the shopper identifiers that are needed for shopper loyalty use cases:

  1. Ask your Adyen contact to enable receiving the card alias in the payment response, for both ecommerce and point-of-sale payments.
  2. Log in to your Customer Area.
  3. Go to Developers > API URLs and on the Additional data settings tab, select:

    • Recurring details: This returns the shopper reference and the recurring detail reference in API responses.
    • Any other details you want to receive. For example, issuer country.

Create profile from online payment

Ask for customer consent

Are you using Drop-in or our Card Component? You can configure your integration to show a Save details for next time check box in your payment form.

If customers select this box, they choose to save and tokenize their card details.

When a customer makes a purchase in your web or in-app store, collect their contact details (such as their email address) in your payment form, and generate a unique reference for them.

To create a customer profile:

  1. Make a POST /payments request to initiate the payment. In this request additionally include:

    • shopperEmail: The customer's email address.
    • shopperReference: Your unique reference for this customer (minimum length three characters).
    • storePaymentMethod: Set this to true if the customer chooses to save their card details for future payments or for a subscription.

    The example below shows how you would make a 10.99 EUR payment request, store the customer's details, and request a token representing their card. This customer has the email address john.smith@example.com and the unique reference john_smith:

    Online payment request
    {
        "amount":{
            "value":1099,
            "currency":"EUR"
        },
        "paymentMethod": {
          "type": "scheme",
          "encryptedCardNumber": "test_4111111111111111",
          "encryptedExpiryMonth": "test_03",
          "encryptedExpiryYear": "test_2030",
          "encryptedSecurityCode": "test_737"
        },
        "reference":"YOUR_ORDER_NUMBER",
        "merchantAccount":"YOUR_MERCHANT_ACCOUNT",
        "returnUrl":"https://your-company.com/...",
        "shopperReference":"john_smith",
        "shopperEmail":"john.smith@example.com",
        "storePaymentMethod":true
    }

    You receive a response containing an additionalData object. If the payment was successful this object includes:

    • shopperEmail: Customer's email address. This echoes the shopperEmail provided in the payment request.
    • shopperReference: Your unique reference for the customer. This echoes the shopperReference provided in the payment request.
    • alias: Value that uniquely represents the customer's card number, for recognition purposes. For NFC wallet transactions, you may receive the PAR instead.
    • recurringDetailReference: Token representing the customer's saved card, for use in future tokenized payments.

    The example below is from a successful payment, where the customer's details were successfully saved with Adyen. This includes a recurringDetailReference 7219687191761347, indicating that their payment method was tokenized.

    Online payment response
    {
        "additionalData":{
            "alias":"M469509594859802",
            "recurring.shopperEmail":"john.smith@example.com",
            "recurring.shopperReference":"john_smith",
            "recurring.recurringDetailReference":"7219687191761347",
            ...
        },
        "pspReference":"881468919096134D",
        "resultCode":"Authorised"
    }
  2. Save the alias or PAR, shopperEmail, shopperReference, and recurringDetailReference in your customer database. For more information, refer to Store customer data.

    You will be able to use these identifiers to recognize this customer when they make a purchase in your online or physical stores.

Next, let's find out how to create a customer profile in store, from a point-of-sale payment.

Create profile from in-store payment

Just like an online purchase, when your customer makes an in-store payment you need to collect their contact details, and then submit these in a payment request.

To encourage your customer to provide you with their contact details, you may want to offer them incentives such as payment-linked loyalty, or the option to receive their receipt by email.

To create a customer profile from an in-store payment:

  1. Collect your customer's contact details, such as an email address.

    There are several ways you could do this. You can let your customer enter this directly on the terminal, using its touch-screen display. Alternatively, your staff could ask them for this information, then enter it in your cash register software.

    In the examples below, we explain how to collect a customer's email address on the terminal. This will use GetText input requests, which you can initiate from your cash register. The OutputText.Text that you provide in this request will be presented to the customer.

    GetText input request
    {
        "SaleToPOIRequest": {
            "MessageHeader": {
                "ProtocolVersion": "3.0",
                "MessageClass": "Service",
                "MessageCategory": "Payment",
                "MessageType": "Request",
                "ServiceID": "0207112304",
                "SaleID": "POSSystemID12345",
                "POIID": "V400m-324688179"
            },
            "InputRequest": {
                "DisplayOutput": {
                    "Device": "CustomerDisplay",
                    "InfoQualify": "Display",
                    "OutputContent": {
                        "OutputFormat": "Text",
                        "PredefinedContent": {
                            "ReferenceID": "GetText"
                        },
                        "OutputText": [
                            {
                                "Text": "Enter your email address"
                            }
                        ]
                    }
                },
                "InputData": {
                    "Device": "CustomerInput",
                    "InfoQualify": "Input",
                    "InputCommand": "TextString",
                    "MaxInputTime": 120,
                    "DefaultInputString": "name@domain.com"
                }
            }
        }
    }

    An on-screen keyboard appears on the terminal, where your customer can enter their email address.

    You receive an input response when the customer has finished entering their email address. The text your customer entered is provided in the Input.TextInput.

    The example below shows what this response would look like if a customer entered john.smith@example.com as their email address.

    GetText input response
    {
      "SaleToPOIResponse": {
        "InputResponse": {
          "InputResult": {
            "Device":"CustomerInput",
            "InfoQualify":"Input",
            ...
            },
            "Input": {
              "TextInput":"john.smith@example.com",
              "InputCommand":"TextString"
            }
          },
          "OutputResult": {
            "Device":"CustomerDisplay",
            "InfoQualify":"Display",
            "Response": {
              "Result":"Success"
            }
          }
        },
        "MessageHeader": {...}
      }
    }

  1. Initiate the payment by making a payment request. In this request, additionally include the following in the PaymentRequest.SaleData object:

    • SaleToAcquirerData: Include the following parameters either as a JSON object converted to a base64-encoded string, or as form-encoded key-value pairs. For our example, we'll use a form-encoded key-value pair format.
      • shopperReference: Your unique reference for the customer (minimum length three characters).
      • shopperEmail: The customer's email address that you received from the GetText input response.
      • recurringContract: If the customer agrees to store their payment details, provide this parameter with a value of RECURRING,ONECLICK. This saves the shopperReference and shopperEmail on our platform, and ensures the values are returned in future card acquisition and payment requests. It also creates a token that you can use for subscriptions and future payments in your online store.

    Before saving a customer's payment details, you should ask for their consent. For more information, see Data privacy.

    The example below shows how you would make a payment request for 10.99 euros, store the customer's details, and request a token representing their card. This customer has the email address john.smith@example.com and the unique reference john_smith.

    Terminal API request
    {
        "SaleToPOIRequest":{
            "MessageHeader":{
                "ProtocolVersion":"3.0",
                "MessageClass":"Service",
                "MessageCategory":"Payment",
                "MessageType":"Request",
                "ServiceID":"0207112304",
                "SaleID":"POSSystemID12345",
                "POIID":"V400m-324688179"
            },
            "PaymentRequest":{
                "SaleData":{
                    "SaleTransactionID":{
                        "TransactionID":"27958",
                        "TimeStamp":"2019-12-12T10:11:04+00:00"
                    },
                    "SaleToAcquirerData":"shopperReference=john_smith&shopperEmail=john.smith@example.com&recurringContract=RECURRING,ONECLICK"
                },
                "PaymentTransaction":{
                    "AmountsReq":{
                        "Currency":"EUR",
                        "RequestedAmount":10.99
                    }
                }
            }
        }
    }

    You receive a payment response containing an PaymentResponse.Response.AdditionalResponse string object. If the payment was successful the string includes:

    • alias: Value that uniquely represents the customer's card.
    • shopperEmail: Customer's email address. This echoes the shopperEmail you provided in the payment request.
    • shopperReference: Your unique reference for the customer. This echoes the shopperReference you provided in the payment request.
    • recurringDetailReference: Token representing this customer's card details.
      You can use this token to offer your customer a more frictionless online checkout experience, or create a subscription to your products or services.

    The example below is from a successful payment, where the customer's details were successfully stored with Adyen. This includes a recurringDetailReference 7219687191761347, indicating that their payment method was tokenized.

    Payment response
    {
      "SaleToPOIResponse":{
        "MessageHeader":{...},
        "PaymentResponse":{
          "Response":{
            "Result":"Success",
            "AdditionalResponse":"...alias=M469509594859802...recurringDetailReference=8315753858208091&shopperReference=john_smith&shopperEmail=john.smith@example.com"
          },
          ...
        },
        "PaymentReceipt":{...}
      }
    }
  2. Store the alias,shopperEmail, shopperReference, and recurringDetailReference in your customer database. For more information, refer to Store customer data.

You will be able to use the card alias, shopperEmail and shopperReference to recognize this customer when they make a purchase again whether online or in store. You can also use the shopperReference and recurringDetailReference to offer the customer a more frictionless online checkout by showing their saved card, or create a subscription to your products or services.

Store customer data

You have to save customer data collected in your online or physical stores as a record in your CRM or other database.

In each customer profile, save the following information:

  • shopperEmail: The customer's email address.
  • Card alias: Value that uniquely represents the customer's card number, for recognition purposes. In case a customer hes multiple cards, link them to the shopper through the shopperEmail.
  • shopperReference: Your unique reference for the customer.
  • recurringDetailReference: Token representing the customer's card details, for use in future tokenized payments. In case a customer has multiple cards, create a token for each card using the same shopperReference in your payments request. Add the new recurringDetailReference returned in the response to the existing customer record. To know if a customer is using a new card, you first need to recognize the customer.

    For more information on creating and managing tokens, see our Tokenization documentation.

You will need to make the data in this record both readable and writable for all your sales channels.

Next steps