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:- Ask your Adyen contact to enable receiving the card alias in the payment response, for both ecommerce and point-of-sale payments.
- Log in to your Customer Area.
-
Go to Developers > Additional data and 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/region.
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 checkbox 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:-
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. Do not include personally identifiable information (PII), for example name or email address (minimum length 3 characters).storePaymentMethod: set this to true if the customer chooses to save their card details for future payments or for a subscription.
If the payment was successful, you receive a response that contains anadditionalDataobject. If the payment was successful this object includes:shopperEmail: customer’s email address. This echoes theshopperEmailprovided in the payment request.alias: value that uniquely represents the customer’s card number, for recognition purposes. For NFC wallet transactions, thealiasis not available.tokenization.shopperReference: your unique reference for the customer. This echoes theshopperReferenceprovided in the payment request.tokenization.storedPaymentMethodId: token representing the customer’s saved card, for use in future tokenized payments.tokenization.store.operationType: created.
storedPaymentMethodId7219687191761347, indicating that their payment method was tokenized. Online payment response -
Save the
aliasor PAR,shopperEmail,shopperReference, andstoredPaymentMethodIdin 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.
Create profile from point-of-sale payment
Just like an online purchase, when your customer makes an in-person 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 a point-of-sale payment:-
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 POS app.
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 POS app. The
OutputText.Textthat you provide in this request will be presented to the customer. GetText input requestAn 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 theInput.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
-
Initiate the payment by making a payment request. In this request, additionally include the following in the
PaymentRequest.SaleDataobject:-
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. Do not include personally identifiable information (PII), for example name or email address (minimum length 3 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 UnscheduledCardOnFile. This saves theshopperReferenceandshopperEmailon 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.
You receive a payment response containing anPaymentResponse.Response.AdditionalResponsestring object. If the payment was successful the string includes:alias: a value that uniquely represents the customer’s card.shopperEmail: the customer’s email address. This echoes theshopperEmailyou provided in the payment request.tokenization.shopperReferenceandrecurring.shopperReference: your unique reference for the customer. This echoes theshopperReferenceyou provided in the payment request.tokenization.storedPaymentMethodIdandrecurring.recurringDetailReference: a 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.
recurringDetailReference7219687191761347, indicating that their payment method was tokenized. Payment response -
-
Store the
alias,shopperEmail,shopperReference, andrecurring.recurringDetailReferenceortokenization.storedPaymentMethodIdin your customer database. For more information, refer to Store customer data.
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 with recurring.recurringDetailReference or tokenization.storedPaymentMethodId 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: a value that uniquely represents the customer’s card number, for recognition purposes. In case a customer has multiple cards, link them to the shopper through theshopperEmail. -
tokenization.shopperReferenceandrecurring.shopperReference: your unique reference for the customer. -
tokenization.storedPaymentMethodIdandrecurring.recurringDetailReference: a 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 sameshopperReferencein your payments request. Add the new token 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.
Next steps
Recognize customers
Required. Identify your returning customers when they make an online or in-person purchase.
Loyalty use case
Offer a loyalty program without a separate loyalty card or app.