---
title: "aid_customers_cid_change_customer_id_post"
method: POST
path: "/accounts/{aid}/customers/users/{customer_id}/change_customer_id"
tags: ["users"]
---

# aid_customers_cid_change_customer_id_post

`POST /accounts/{aid}/customers/users/{customer_id}/change_customer_id`

## Request

- Base URL: `https://api.dintero.com/v1`
- URL: `https://api.dintero.com/v1/accounts/{aid}/customers/users/{customer_id}/change_customer_id`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/dintero/apis/account-management-api/docs/accounts/:aid/customers/users/:customer_id/change_customer_id/post.ts> (a function with typed inputs; its response is checked against the schema)

Update customer_id for an customer
**warning**: Any external resources "owned" by the user, i.e
receipts, discounts etc. will not be updated with the new
customer_id.
A new metadata property `dintero_change_customer_id_{timestamp}.{hash}`
will be added everytime the customer_id is changed
Following data will be included in the metadata property
 - created_at
 - created_by
 - old
 - new
scopes:
- admin:customers
- admin:accounts

## Path parameters

- `aid` string, ^[PT]{1}\d{8}$, required
- `customer_id` string, required

## Request body

- object
  - `customer_id` string: New customer_id (must not have trailing or leading spaces).

## Response `200`

Customer updated

- CustomerResponse
  - `metadata` object: A set of key/value pairs that you can attach to a customer object. It can be useful for storing additional information about the customer in a structured format. You can unset an individual key by setting its value to null and then saving. To clear all keys, set metadata to null
  - `id` string, uuid: An UUID that uniquely identifies the resource
  - `created_at` string, date-time: The date-time when the resource was created
  - `created_by` string: The ID of the user/client created the resource
  - `updated_at` string, date-time: The date-time when the resource was last updated
  - `deleted_by` string: The ID of the user/client created the resource
  - `deleted_at` string, date-time
  - `first_name` string, nullable
  - `last_name` string, nullable
  - `email` string, nullable: customer email, case insensitive duplication control prevents multiple user with same `type` to have equal email customer@example.com is equal to CUStOMer@EXAMPLE.com
  - `phone_number` string, ^\+?[1-9]\d{1,14}$, nullable: A phone number in E.164 number formatting.
  - `attributes` object: Custom attributes
  - `status` string, nullable: Status of the customer
  - `favorite_store` string, nullable: customer favorite store
  - `enrolled_by` object: The source that recruited the customer
    - `type` string: Enrollment type, e.g. `url`, `store`, `qr_code`, any string
    - `value` string, nullable, required
  - `marketing_consent` object: Customers consent for marketing in different channels
    - `sms` UserConsent
      - `consent` boolean
      - `updated_at` string, date-time: The date-time when the resource was last updated:
    - `email` UserConsent
      - `consent` boolean
      - `updated_at` string, date-time: The date-time when the resource was last updated:
  - `type` 'customer' | 'company' | 'contact' | 'employee' | 'other', required: Describe type of a user. - `company` property is required when using the type `company` - `company` property is only supported for users with type `other` or `company` - Creating or updating user with type `employee` or `other` requires `admin:customers` or `write:customers` scope. - User login is only available for users with type `customer` or `company`
  - `addresses` CustomerAddress[]
    - `address_line` string, required
    - `address_line_2` string
    - `postal_code` string
    - `postal_place` string, required
    - `country` string, iso-3166-1, required: ISO 3166-1 country code
    - `latitude` number
    - `longitude` number
    - `type` 'custom' | 'home' | 'other' | 'work': The address type
    - `custom_type` string: If the address `type` is `custom`, this property contains the custom value
    - `comment` string: Comment about the address
  - `term` CustomerTerm
    - `id` string, uuid
    - `accepted_at` string, date-time
  - `company` object: Company details, supported when type is Company
    - `organization_number` string: Companys identification number
    - `bussiness_name` string, required
    - `department` string: companys department
    - `industry` string
    - `website` string
    - `number_of_employees` string
  - `gender` string, nullable
  - `date_of_birth` string, date, nullable
  - `contact_for` object[]: The users that it is a contact for, supported when type is `contact`
    - `customer_id` string, required: The customer id that it is a contact for
  - `customer_id` string, required: The customer id you have defined for the customer. (must not have trailing or leading spaces) An auto-generated customer_id will be created if no customer_id is provided.

## Other responses

- `400`: Bad / Invalid request
- `401`: Access forbidden, invalid JWT token was used
- `403`: Forbidden
- `404`: Resource was not found
- `500`: Unexpected Error

---

[API](https://skmtc.dev/dintero/apis/account-management-api.md) - [All operations](https://skmtc.dev/dintero/apis/account-management-api/llms.txt) - [OpenAPI document](https://skmtc.dev/dintero/apis/account-management-api/revisions/9b83a4199008?raw)
