Create a Profile for a Customer
POST /customervault/v1/profiles
See our full API documentation for a complete description of the parameters required for the profile creation request.
A profile contains basic information about your customer, such as their unique identifier, their locale (language), and their name and contact information.
To create a profile you must make a POST request to the profiles endpoint containing the customer's ID and locale; optionally, you can also include their card details, bank account details, or a single-use payment token representing these details (which expires after 15 minutes) and receive a permanent, re-usable payment token in the response. The example below describes the basic POST request and response.
View the API Reference document for details on the multiple additional ways you can create a profile, including using a credit card, a bank account, or a single-use token.
curl -X POST https://api.test.paysafe.com/customervault/v1/profiles \
-u devcentre322:B-qa2-0-53625f86-302c021476f52bdc9deab7aea876bb28762e62f92fc6712d0214736abf501e9675e55940e83ef77f5c304edc7968 \
-H 'Content-Type: application/json' \
-d ' {
"merchantCustomerId":"mycustomer1",
"locale" : "en_US",
"firstName" : "John",
"lastName" : "Smith",
"phone" : "713-444-5555",
"email" : "john.smith@somedomain.com",
"cellPhone" : "713-444-5556"
}'
Before trying the example, you should:
- Replace the API key (after the -u) with the API key you have received.
- Provide a unique merchant customer ID number for each profile you create.
Before using a card or single-use payment token to create a profile, you should verify that it is valid using the Card Payments API. Verifying a single-use token does not use it up.
Element | Type | Required? | Description |
---|---|---|---|
card | object | No* | *Required only when a card or single-use payment token is being used to create a profile. This is the single-use payment token or card details. |
merchantCustomerId | string | Yes length<=100 | This is the ID that the merchant provides with the request for their own internal customer identification. This value must be unique for each customer belonging to a merchant. |
locale | enum | Yes | This indicates the language of the profile. Possible values are:
|
firstName | string | No length<=80 | This is the customer's first name. |
lastName | string | No length<=80 | This is the customer's last name. |
phone | string | No length<=40 | This is the customer's phone number. |
string | No length<=255 | This is the customer's email address. | |
cellPhone | string | No length<=40 | This is the customer's cell phone number. |
{
"id" : "716adb4f-6b85-4089-ba9c-d9c0eb649cd7",
"status" : "ACTIVE",
"merchantCustomerId" : "mycustomer1",
"locale" : "en_US",
"firstName" : "John",
"lastName" : "Smith",
"phone" : "713-444-5555",
"cellPhone" : "713-444-5556"
"email" : "john.smith@somedomain.com",
"paymentToken" : "PyhYo1nGKUfWOPj"
}
The response contains all the profile details submitted in the request and the new profile's unique ID. Make a note of the ID to use later for updating the profile and linking address, card, and bank details. The response-specific values are shown below.
Element | Type | Description |
---|---|---|
id | string | This is the profile identifier. |
paymentToken | string length<=50 | This is a token representing the customer. This is not a usable payment token. |
status | enum | The status of the profile request:
|
The paymentToken in the response above cannot be used for making payments. Only a paymentToken inside a cards object is a valid permanent token (or inside a bankAccounts object when including banking information for creating a profile).