v1

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

CreateCustomer

Creates a new customer for a business.

You must provide at least one of the following values in your request to this endpoint:

  • given_name
  • family_name
  • company_name
  • email_address
  • phone_number
post/v2/customers

Request body

idempotency_keystring

The idempotency key for the request. For more information, see Idempotency.

given_namestring

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

The maximum length for this value is 300 characters.

family_namestring

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

The maximum length for this value is 300 characters.

company_namestring

A business name associated with the customer profile.

The maximum length for this value is 500 characters.

nicknamestring

A nickname for the customer profile.

The maximum length for this value is 100 characters.

email_addressstring

The email address associated with the customer profile.

The maximum length for this value is 254 characters.

phone_numberstring

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

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

A custom note associated with the customer profile.

birthdaystring

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.

Example request

{
  "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"
  },
  "email_address": "Amelia.Earhart@example.com",
  "family_name": "Earhart",
  "given_name": "Amelia",
  "note": "a customer",
  "phone_number": "+1-212-555-4240",
  "reference_id": "YOUR_REFERENCE_ID"
}

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": "Amelia.Earhart@example.com",
    "family_name": "Earhart",
    "given_name": "Amelia",
    "id": "JDKYHBWT1D4F8MFH63DBMEN8Y4",
    "note": "a customer",
    "phone_number": "+1-212-555-4240",
    "preferences": {
      "email_unsubscribed": false
    },
    "reference_id": "YOUR_REFERENCE_ID",
    "updated_at": "2016-03-23T20:21:54.859Z",
    "version": 0
  }
}