Creating a customer
Learn how to create a customer.
Creating a customer account enables shoppers to purchase when guest checkout is unavailable. This guide will help you understand how to create a customer account by leveraging the API key or access token to authenticate the request. Follow the steps below to successfully set up a new customer account for shoppers on your site.
You can make this request without an access token by passing in your API key as a query parameter. You can also send this request with a valid anonymous or authenticated customer token.
Creating a shopper
To create a shopper, send a POST /v1/shoppers request with the customer's information in the request payload. This request requires either an access token or an API key.
If Digital River manages the customer login credentials, include username and password in the request body, with a base64 encoded password.
If your company manages the customer login credentials, include the externalReferenceId in the payload. If you do not specify an externalReferenceId, Digital River will assign a shopperId.
curl --location --request POST 'https://api.digitalriver.com/v1/shoppers' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic {{access_token}}' \
--header 'Cookie: {{token}}' \
--data-raw '{
"shopper": {
"username": "[email protected]",
"firstName": "Jane",
"lastName": "Doe",
"emailAddress": jdoe@dr.com,
"password": "jdoepassword",
"currency": "USD"
"locale": "en_US",
}
}'curl --location -g --request POST 'api.digitalriver.com/v1/shoppers' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic {{access_token}}' \
--header 'Cookie: {{token}}' \
--data-raw '{
"shopper": {
"username": "[email protected]",
"firstName": "Jane",
"lastName": "Doe",
"emailAddress": jdoe@acme.com,
"currency": "USD"
"locale": "en_US",
"externalReferenceId": "efe44307-ef82-46ed-bef4-e87ebec2ba28"
}
}'Required payload contents
The required payload contents depend on whether Digital River or your company manages the customer login credentials. Here are the minimum required fields:
usernamepassword(base64 encoded): Only required for a Digital River-hosted shopper.emailAddressexternalReferenceId: Only required for a client-hosted shopper.firstNamelastName
{
"shopper": {
"username": "[email protected]",
"firstName": "Jane",
"lastName": "Doe",
"emailAddress": [email protected],
"password": "jdoepassword",
"currency": "USD"
"locale": "en_US",
}
}The response from the server will be an HTTP Status 201 Created.
After creating the base customer record, you can obtain an authenticated customer token.
curl --location --request POST 'https://api.digitalriver.com/v1/shoppers' \
--header 'Authorization: bearer {{access_token}}' \
...The following example passes in your API key instead of an access token:
curl --location --request POST 'https://api.digitalriver.com/v1/shoppers? apiKey=your_api_key' \
...Last updated
Was this helpful?