# Create a customer

Creates a customer. Creating a second one with the same email, for
the same merchant, fails with `409`.

Endpoint: POST /customers
Security: ClientKey, SecretKey

## Security:

  - `ClientKey` (unknown)
    apiKey in header X-Dime-Client

  - `SecretKey` (unknown)
    http bearer

## Request fields (application/json):

  - `first_name` (string, required)
    Example: Michael

  - `last_name` (string, required)
    Example: Scott

  - `email` (string, required)
    Example: mscott@example.com

  - `phone` (string)
    Example: +18765551234

  - `company` (string)
    Example: Dunder Mifflin

  - `billing_address_street` (string)
    Example: 555 Lackawanna Ave

  - `billing_address_city` (string)
    Example: Scranton

  - `billing_address_state` (string)
    Example: Pennsylvania

  - `billing_address_postal_code` (string)
    Example: 18508

  - `billing_address_country` (string)
    Example: United States

  - `shipping_address_street` (string)
    Example: 555 Lackawanna Ave

  - `shipping_address_city` (string)
    Example: Scranton

  - `shipping_address_state` (string)
    Example: Pennsylvania

  - `shipping_address_postal_code` (string)
    Example: 18508

  - `shipping_address_country` (string)
    Example: United States

  - `notes` (string)
    Example: Prefers email over phone.

  - `custom_attributes` (object)
    Example: {"loyalty_tier":"gold"}

  - `is_active` (boolean)
    Only applied on replace. Defaults to true on create.
    Example: true

## Request examples:

  - `A customer with a billing address` (unknown)

## Response 201:

  - `201` (unknown)
    The customer was created.

## Response 201 fields (application/json):

  - `object` (string)
    Enum: "customer"

  - `token` (string)
    Identifies the customer. Use it in customer URLs and wherever a
request refers to the customer.
    Example: cus_2ex3bH8t_I8wppHr5_nnWIbSOb_0xGEWoW

  - `first_name` (string)
    Example: Michael

  - `last_name` (string)
    Example: Scott

  - `email` (string)
    Example: mscott@example.com

  - `phone` (string | null)
    Example: +18765551234

  - `company` (string | null)
    Example: Dunder Mifflin

  - `billing_address_street` (string | null)
    Example: 555 Lackawanna Ave

  - `billing_address_city` (string | null)
    Example: Scranton

  - `billing_address_state` (string | null)
    Example: Pennsylvania

  - `billing_address_postal_code` (string | null)
    Example: 18508

  - `billing_address_country` (string | null)
    Example: United States

  - `shipping_address_street` (string | null)
    Example: 555 Lackawanna Ave

  - `shipping_address_city` (string | null)
    Example: Scranton

  - `shipping_address_state` (string | null)
    Example: Pennsylvania

  - `shipping_address_postal_code` (string | null)
    Example: 18508

  - `shipping_address_country` (string | null)
    Example: United States

  - `notes` (string | null)
    Example: Prefers email over phone.

  - `custom_attributes` (object | null)
    Example: {"loyalty_tier":"gold"}

  - `is_active` (boolean)
    Example: true

  - `created_at` (string)
    Example: 2026-08-26T00:48:52.252Z

  - `updated_at` (string)
    Example: 2026-08-26T00:48:52.252Z

## Response 400:

  - `400` (unknown)
    The request was rejected.

## Response 400 fields (application/json):

  - `error` (object, required)

  - `error.type` (string, required)
    Which kind of failure occurred. Always one of four values, so
a client can branch on `type` before reading `code`.
    Enum: "invalid_request_error", "card_error", "idempotency_error", "api_error"

  - `error.code` (string, required)
    Example: parameter_missing

  - `error.message` (string, required)
    Example: Order ID is required.

  - `error.param` (string)
    The field that caused the failure, when applicable.
    Example: id

## Response 401:

  - `401` (unknown)
    The client key or secret key was missing, not recognized, or the two do not belong to the same key.

## Response 401 fields (application/json):

  - `error` (object, required)

  - `error.type` (string, required)
    Which kind of failure occurred. Always one of four values, so
a client can branch on `type` before reading `code`.
    Enum: "invalid_request_error", "card_error", "idempotency_error", "api_error"

  - `error.code` (string, required)
    Example: parameter_missing

  - `error.message` (string, required)
    Example: Order ID is required.

  - `error.param` (string)
    The field that caused the failure, when applicable.
    Example: id

## Response 409:

  - `409` (unknown)
    This merchant already has a customer with this email.

## Response 409 fields (application/json):

  - `error` (object, required)

  - `error.type` (string, required)
    Which kind of failure occurred. Always one of four values, so
a client can branch on `type` before reading `code`.
    Enum: "invalid_request_error", "card_error", "idempotency_error", "api_error"

  - `error.code` (string, required)
    Example: parameter_missing

  - `error.message` (string, required)
    Example: Order ID is required.

  - `error.param` (string)
    The field that caused the failure, when applicable.
    Example: id

## Response 201 examples:

  - `A new customer` (unknown)

## Response 400 examples:

  - `A required field was absent` (unknown)

## Response 401 examples:

  - `unauthorized` (unknown)

  - `Client key sent without its secret key` (unknown)

## Response 409 examples:

  - `duplicate` (unknown)

