Customers

Create a customer

Changed on

Create a new customer record for the authenticated store.

post/v1/customers

Request

Request body

emailstring required

The email address of the customer.

namestring required

The full name of the customer.

metadataobject

Additional metadata for the customer.

external_idstring

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

Example request

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

Response

Successfully created 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

    • breaking

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

    • info

      added the new optional request property

    • info

      added the optional property to the response with the status