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.
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:
- 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.
The example below shows how you would make a EUR 10.99 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 ShopperID-A16729:
You receive a response containing an
additionalData
object. If the payment was successful this object includes:shopperEmail
: customer's email address. This echoes theshopperEmail
provided in the payment request.shopperReference
: your unique reference for the customer. This echoes theshopperReference
provided in the payment request.alias
: value that uniquely represents the customer's card number, for recognition purposes. For NFC wallet transactions, thealias
is not available.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. -
Save the
alias
or PAR,shopperEmail
,shopperReference
, andrecurringDetailReference
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 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.Text
that you provide in this request will be presented to the customer.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.
-
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. 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 RECURRING,ONECLICK. This saves theshopperReference
andshopperEmail
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 following example shows how to 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 ShopperID-A16729.
You receive a payment response containing an
PaymentResponse.Response.AdditionalResponse
string 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 theshopperEmail
you provided in the payment request.shopperReference
: your unique reference for the customer. This echoes theshopperReference
you provided in the payment request.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.
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. -
Store the
alias
,shopperEmail
,shopperReference
, andrecurringDetailReference
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
: a 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 theshopperEmail
. shopperReference
: your unique reference for the customer.-
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 sameshopperReference
in your payments request. Add the newrecurringDetailReference
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.