Creating and updating customers
Learn how to create and update a customer.

Defining a customer

The following provides guidance on how to define a customer. For complete specifications, refer to the Checkouts API reference documentation.

Unique identifier

When you create a customer, you can specify its unique id. We recommend that a customer's identifier be identical in both your system and our system.
If you don't provide us an id value in the create customer request, we generate one for you and return it in the response.

Email

The email parameter represents a customer's email address. You can create multiple customers in your account that contain identical email values.

Shipping address

You can use shipping to store a customer's name, phone, email, organization, basic ship to address, and detailed ship to additionalAddressInfo.

Tax identifiers and certificates

Every customer can store one or more tax identifiers and tax certificates.

Locale

A customer's locale is used to localize invoices and credit memos.

Customer type

Enabling a customer

If you set a customer's enabled flag to false, then any attempts to create orders that reference this customer will fail. You should only set enabled to false when you want to block a customer from placing orders. For example, you may decide this is necessary when a customer has a history of fraudulent behavior.

Default payment source

The defaultSourceId should reference a source that customers have indicated is their default payment instrument.
For more information, refer to setting the default payment source on the Managing sources page.

Request to be forgotten

In update customer requests, you can use requestToBeForgotten to instruct Digital River to delete a customer's data from our system.
For more information, refer to the Recording a customer's request to be forgotten page.

Creating a customer

The process of creating and updating a customer is similar. In a create customer request, you're allowed to specify the object's unique identifier. However, when updating a customer you must pass in this unique identifier as a path parameter.
An update customer request also allows you to record a customer's right to be forgotten.
The following POST/customers request specifies a unique id:
POST/customers
1
curl --location --request POST 'https://api.digitalriver.com/customers' \
2
--header 'Content-Type: application/json' \
3
--header 'Authorization: Bearer <API_key>' \
4
--data-raw '{
5
"id": "5823594806",
6
"email": "[email protected]",
7
"shipping": {
8
"address": {
9
"line1": "10380 Bren Rd W",
10
"line2": "string",
11
"city": "Minnetonka",
12
"postalCode": "55129",
13
"state": "MN",
14
"country": "US"
15
},
16
"name": "John Smith",
17
"phone": "952-111-1111",
18
"email": "[email protected]",
19
"organization": "Digital River"
20
},
21
"type": "individual",
22
"metadata": {
23
"coupon": "iOS"
24
},
25
"locale": "en_US",
26
"enabled": true
27
}'
Copied!
A successful request returns a 201 Created whose payload contains a customer object:
201 Created
1
{
2
"id": "5823594809",
3
"createdTime": "2020-05-06T22:28:01Z",
4
"email": "[email protected]",
5
"shipping": {
6
"address": {
7
"line1": "10380 Bren Rd W",
8
"city": "Minnetonka",
9
"postalCode": "55129",
10
"state": "MN",
11
"country": "US"
12
},
13
"phone": "952-111-1111",
14
"email": "[email protected]"
15
},
16
"enabled": true,
17
"requestToBeForgotten": false,
18
"locale": "en_US",
19
"type": "individual",
20
"liveMode": false
21
}
Copied!
Once you create a customer, you can the reference this object in registered checkouts.
Last modified 1mo ago