v1

latestOpenAPI 3.0.0Apache 2.02026-07-143281,4552.1 MB
Customers

UpdateCustomer

Updates a customer profile. This endpoint supports sparse updates, so only new or changed fields are required in the request. To add or update a field, specify the new value. To remove a field, specify null.

To update a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile.

put/v2/customers/{customer_id}

Path parameters

customer_idstring required

The ID of the customer to update.

Request body

given_namestring nullable

The given name (that is, the first name) associated with the customer profile.

The maximum length for this value is 300 characters.

family_namestring nullable

The family name (that is, the last name) associated with the customer profile.

The maximum length for this value is 300 characters.

company_namestring nullable

A business name associated with the customer profile.

The maximum length for this value is 500 characters.

nicknamestring nullable

A nickname for the customer profile.

The maximum length for this value is 100 characters.

email_addressstring nullable

The email address associated with the customer profile.

The maximum length for this value is 254 characters.

phone_numberstring nullable

The phone number associated with the customer profile. The phone number must be valid and can contain 9–16 digits, with an optional + prefix and country code. For more information, see Customer phone numbers.

reference_idstring nullable

An optional second ID used to associate the customer profile with an entity in another system.

The maximum length for this value is 100 characters.

notestring nullable

A custom note associated with the customer profile.

birthdaystring nullable

The birthday associated with the customer profile, in YYYY-MM-DD or MM-DD format. For example, specify 1998-09-21 for September 21, 1998, or 09-21 for September 21. Birthdays are returned in YYYY-MM-DD format, where YYYY is the specified birth year or 0000 if a birth year is not specified.

versioninteger

The current version of the customer profile.

As a best practice, you should include this field to enable optimistic concurrency control. For more information, see Update a customer profile.

Example request

{
  "email_address": "New.Amelia.Earhart@example.com",
  "note": "updated customer note",
  "phone_number": null,
  "version": 2
}

Response

Success

Example response

{
  "customer": {
    "address": {
      "address_line_1": "500 Electric Ave",
      "address_line_2": "Suite 600",
      "administrative_district_level_1": "NY",
      "country": "US",
      "locality": "New York",
      "postal_code": "10003"
    },
    "created_at": "2016-03-23T20:21:54.859Z",
    "creation_source": "THIRD_PARTY",
    "email_address": "New.Amelia.Earhart@example.com",
    "family_name": "Earhart",
    "given_name": "Amelia",
    "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4",
    "note": "updated customer note",
    "preferences": {
      "email_unsubscribed": false
    },
    "reference_id": "YOUR_REFERENCE_ID",
    "updated_at": "2016-05-15T20:21:55Z",
    "version": 3
  }
}