# Replace a customer

Replaces the customer. This is a full replacement, not a patch — a
field you omit is cleared, not left unchanged. Re-send every field
you want to keep.

Endpoint: PUT /customers/{token}
Security: ClientKey, SecretKey

## Security:

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

  - `SecretKey` (unknown)
    http bearer

## Path parameters:

  - `token` (string, required)
    The customer's `token`, from create or list.

## 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

## Response 200:

  - `200` (unknown)
    The updated customer.

## Response 200 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 404:

  - `404` (unknown)
    No record matches the token in the request. A database id in a URL
also ends here: v2 looks records up by token only.

## Response 404 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)
    Another customer of this merchant already uses 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 200 examples:

  - `Company added` (unknown)

## Response 400 examples:

  - `A required field was absent` (unknown)

## Response 401 examples:

  - `unauthorized` (unknown)

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

## Response 404 examples:

  - `missing` (unknown)

