Creating a customer

Learn how to create a customer.

When you create a Customer, you can place an order for a customer by creating a checkout for the customer and then submitting it. You may also attach payment sources to the customer.

Setting Customer parameters

When you create a Customer, you may provide the identifier for that customer. If you don't provide an identifier, we will provide one for you.

Parameter

Required/Optional

Description

id

Optional

Unique identifier of a customer.

email

Optional

The customer email address.

shipping

Optional

The customer shipping information.

taxIdentifiers

Optional

A list of tax identifiers for this customer.

taxCertificate

Optional

A tax certificate for this customer.

metadata

Optional

Stores additional, structured information on an object. See Metadata.

locale

Optional

Refer to Designating a locale. Note that the Checkout locale overrides the Customers locale.

type

Optional

The type of customer. The enumerators are business and individual.

enabled

Optional

If present, usually used to disable the customer (by default, true). If false, attempts to create orders for the customer will fail. You can set it to false when you want to block a customer from placing orders. For example, you can set it to false when a customer behaves fraudulently.

Example create request and response

Create a Customer object that includes a default shipping address with a POST request:

cURL
cURL
curl https://api.digitalriver.com/customers \
-u sk_test_db9682a2-b04a-4e94-8e11-35fe8ec0b324: \
-d id="5823594808" \
-d email="jsmith@digitalriver.com" \
-d shipping[phone]="952-111-1111" \
-d shipping[email]="jsmith@digitalriver.com" \
-d shipping[address][line1]="10380 Bren Rd W" \
-d shipping[address][city]="Minnetonka" \
-d shipping[address][postalCode]="55129" \
-d shipping[address][state]="MN" \
-d shipping[address][country]="US"

A 201 Created response returns a Customer object:

Response example
Response example
{
"id": "5823594809",
"createdTime": "2020-05-06T22:28:01Z",
"email": "jsmith@digitalriver.com",
"shipping": {
"address": {
"line1": "10380 Bren Rd W",
"city": "Minnetonka",
"postalCode": "55129",
"state": "MN",
"country": "US"
},
"phone": "952-111-1111",
"email": "jsmith@digitalriver.com"
},
"enabled": true,
"requestToBeForgotten": false,
"locale": "en_US",
"type": "individual",
"liveMode": false
}

Once you create a customer, you can then create checkouts for this customer.