Customers

Update a customer

Changed on
patch/v1/customers

Request

Request body

customer_idstring required

The ID of the customer to update.

namestring

The full name of the customer.

emailstring

The email address of the customer. Must be unique within the store; changing it to an email already used by another customer returns 409. Stored lowercased. Omit to leave unchanged.

metadataobject

Additional metadata for the customer. Omit to leave unchanged; send null to clear it.

external_idstring nullable

Your own id for this customer. Unique per store; usage ingestion resolves external_customer_id against it. Omit to leave unchanged; send null to clear it. Trimmed; letters, digits, _ and - only; at most 255 characters.

Example request

{
  "customer_id": "cust_abc123",
  "name": "John Doe",
  "email": "john@example.com",
  "metadata": {
    "key": "value"
  },
  "external_id": "user-42"
}

Response

Successfully updated the customer

idstring required

Unique identifier for the object.

mode'test' | 'prod' | 'sandbox' required

String representing the environment.

objectstring required

String representing the object’s type. Objects of the same type share the same value.

emailstring required

Customer email address.

namestring nullable

Customer name.

metadataobject nullable

Additional metadata associated with the customer.

countrystring nullable required

The ISO 3166-1 alpha-2 country code for the customer.

external_idstring nullable

Your own id for this customer, when you have set one — usage ingestion resolves external_customer_id against it.

created_atstring date-time required

Creation date of the customer

updated_atstring date-time required

Last updated date of the customer

Example response

{
  "email": "user@example.com",
  "name": "John Doe",
  "metadata": {
    "key": "value"
  },
  "country": "US",
  "external_id": "user-42",
  "created_at": "2023-01-01T00:00:00Z",
  "updated_at": "2023-01-01T00:00:00Z"
}

Changes

    • info

      added the new optional request property

    • breaking

      the request property type changed from object to string

    • breaking

      the response's property type changed from object to string for status