Skip to main content

Customer profiles

Customer profiles are a powerful feature that allows you to store and manage customer data and payment details. This guide will walk you through the process of setting up, creating, and using customer profiles.

Reference

For more details on customer profiles, check out the in-depth article on customer profiles in the reference.

IXOPAY platform Full Version

Customer profiles are an optional feature which is not automatically available for all IXOPAY platform clients!

If you want to get access to all IXOPAY platform features you need to upgrade your plan. Please contact our customer success team at [email protected] or our sales team at [email protected] for more information.

Setting up customer profiles

Before you can start creating and using customer profiles, you need to set up customer profile containers. These containers serve as storage for the customer profiles and can be shared across sub-tenants, enabling multiple merchants within the same ecosystem to access shared customer profiles.

Here's how you can set up customer profile containers:

  1. Navigate to the tokenization configuration: Go to the Tokenization > Customer Profiles section.
  2. Select the tenant (optional1): Choose the tenant for which you want to create or edit a customer profile container.
  3. Create a new container: Click on '➕ New Container' to create a new customer profile container.
  4. Enter a container name: Provide a name for your new container.
  5. Create the container: Click on '➕ Create' to create the container.

Once the container is created, it will appear in the Customer Profile Container Overview and can be edited at any time. You can also access the customer profiles stored in the container by clicking 'show'.

To store customer profiles in a container, you need to assign the customer profile container to a connector. Any successful register transaction or debit/preauthorize transaction with the withRegister flag set to true processed by this Connector will automatically add the customer data and used payment instrument for subsequent charges as a Customer Profile in this container. You can assign a Customer Profile Container either in the Connector Base Data or using Global Settings.

Creating a customer profile

Step 1: Initiate a debit transaction with register

During the customer's first purchase, initiate a debit or preauthorize transaction with the withRegister flag enabled, or a register transaction. In this example, we use a debit transaction as described in the Getting-started guide on payment.js. This transaction will transfer funds and create a new customer profile. Ensure that you set the customerProfileData field during this transaction. Additionally, if you set the customerProfileData.customerIdentification field to a value of your choosing, you can later look-up the customer profile via this value.

curl --request POST -sL \
--url "https://gateway.ixopay.com/api/v3/transaction/${API_KEY}/debit" \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header "Authorization: Basic $(echo "$USERNAME:$PASSWORD" | base64)" \
--data-raw '{
"merchantTransactionId": "your-unique-identifier",
"transactionToken": "$CC_TOKEN",
"description": "My purchase description as shown in the credit card statement.",
"amount": "9.99",
"currency": "EUR",
"successUrl": "https://shop.example.org/checkout/success",
"cancelUrl": "https://shop.example.org/checkout/cancelled",
"errorUrl": "https://shop.example.org/checkout/error",
"callbackUrl": "https://api.example.org/checkout/callback",
"withRegister": true,
"customerProfileData": {
"customerIdentification": "23ac38bf-c5cd-4001-9d60-ba373130cd74",
"markAsPreferred": true
}
}'

Step 2: Store the customer profile ID

Once the transaction is successful, the system will automatically assign a profileGuid to the customer profile. You should store either the customerProfileData.customerIdentification or customerProfileData.profileGuid in your database under the user's entry. This ID will be used to retrieve the customer profile in the future.

HTTP/1.1 200 OK
Content-Type: application/json

{
"success": true,
"uuid": "d94c0d72f3a36e21f16e",
"purchaseId": "20241112-d94c0d72f3a36e21f16e",
"returnType": "FINISHED",
"paymentMethod": "Creditcard"
"customerProfileData": {
"profileGuid": "CP-1234-5678-9ABC-DEF0-1234-5678",
"customerIdentification": "616c6578-2e73-6d69-7468-406578616d70",
"paymentToken": "pt::b639e636df17af782602"
}
}

Using a customer profile

Step 1: Authenticate the user

Before you can use a customer profile, you need to ensure that the user is authenticated. This is crucial because it prevents unauthorized access to the customer's profile.

# See other languages

Step 2: Fetch the stored customer profile

After the user is authenticated, you can fetch the stored customer profile from the IXOPAY platform. This ID used could be either the customerProfileData.customerIdentification or customerProfileData.profileGuid that you stored during the creation of the customer profile.

curl --request POST -sL \
--url "https://gateway.ixopay.com/api/v3/customerProfiles/${API_KEY}/getProfile" \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header "Authorization: Basic $(echo "$USERNAME:$PASSWORD" | base64)" \
--data-raw '{
"customerIdentification": "23ac38bf-c5cd-4001-9d60-ba373130cd74",
}'

Step 3: Extract the payment instrument and payment token

Next, you need to extract the payment instrument and paymentToken from the customer profile. The payment instrument refers to the method of payment that the customer has chosen, such as credit card, debit card, or bank transfer. The paymentToken is a unique identifier for the payment instrument.

Optional: if there are multiple payment instruments stored for a customer, you could present them to the customer and let the customer choose which one to use.

HTTP/1.1 200 OK
Content-Type: application/json

{
"success": true,
"profileExists": "true",
"profileGuid": "CP-1234-5678-9ABC-DEF0-1234-5678",
"customerIdentification": "616c6578-2e73-6d69-7468-406578616d70",
"preferredMethod": "Creditcard",
"customer": {
"identification": "616c6578-2e73-6d69-7468-406578616d70",
"billingCountry": "US",
"birthDate": "1970-01-01",
"email": "[email protected]"
},
"paymentInstruments": [
{
"_TYPE": "card",
"createdAt": "2029-11-13 12:36:44",
"method": "card",
"paymentData": {
"_TYPE": "paymentData.card",
"brand": "visa",
"cardHolder": "Alex Smith",
"expiryMonth": 11,
"expiryYear": 2029,
"firstSixDigits": "411111",
"lastFourDigits": "1111"
},
"paymentToken": "pt::b639e636df17af782602",
"isPreferred": true
}
]
}

Step 4: Initiate debit a transaction

Finally, you can initiate a debit transaction using the paymentToken. It's worth noting that while this example demonstrates a debit transaction, the same process applies to various transaction types. Regardless of the transaction type, you need to include the paymentToken in the transactionToken field of the transaction request. This will allow the system to process the transaction using the stored payment instrument.

For more details on executing transactions, refer to the Executing transactions section in the reference article.

curl --request POST -sL \
--url "https://gateway.ixopay.com/api/v3/transaction/${API_KEY}/debit" \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header "Authorization: Basic $(echo -n "$USERNAME:$PASSWORD" | base64)" \
--data-raw '{
"merchantTransactionId": "your-unique-identifier",
"transactionToken": "pt::b639e636df17af782602",
"description": "Purchase description shown on credit card statement.",
"amount": "9.99",
"currency": "EUR",
"successUrl": "https://shop.example.org/checkout/success",
"cancelUrl": "https://shop.example.org/checkout/cancelled",
"errorUrl": "https://shop.example.org/checkout/error",
"callbackUrl": "https://api.example.org/callback"
}'

By following these steps, you can leverage customer profiles to provide a seamless and efficient checkout experience for your customers.

Footnotes

  1. This step applies only if you have multiple tenants set up.