# The customer object

A customer object is returned as part of the response body of each successful list, retrieve, create or update API call to the `/api/customers` endpoint.

## Fields

| Field                                                                  | Type      | Description                                                                                                                                                                                         |
| ---------------------------------------------------------------------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **type**                                                               | `string`  | `customers`                                                                                                                                                                                         |
| **id**                                                                 | `string`  | The customer unique identifier                                                                                                                                                                      |
| links.**self**                                                         | `string`  | The customer endpoint URL                                                                                                                                                                           |
| attributes.**email**                                                   | `string`  | The customer's email address.                                                                                                                                                                       |
| attributes.**password**                                                | `string`  | The customer's password. Initiate a customer password reset flow if you need to change it.                                                                                                          |
| attributes.**status**                                                  | `string`  | The customer's status. One of 'prospect' (default), 'acquired', or 'repeat'.                                                                                                                        |
| attributes.**has\_password**                                           | `boolean` | Indicates if the customer has a password.                                                                                                                                                           |
| attributes.**total\_orders\_count**                                    | `integer` | The total number of orders for the customer.                                                                                                                                                        |
| attributes.**shopper\_reference**                                      | `string`  | A reference to uniquely identify the shopper during payment sessions.                                                                                                                               |
| attributes.**profile\_id**                                             | `string`  | A reference to uniquely identify the customer on any connected external services.                                                                                                                   |
| attributes.**tax\_exemption\_code**                                    | `string`  | A specific code to identify the tax exemption reason for this customer.                                                                                                                             |
| attributes.**\_add\_tags**                                             | `string`  | Comma separated list of tags to be added. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.                                                              |
| attributes.**\_remove\_tags**                                          | `string`  | Comma separated list of tags to be removed. Duplicates, invalid and non existing ones are discarded. Cannot be passed by sales channels.                                                            |
| attributes.**created\_at**                                             | `string`  | Time at which the resource was created.                                                                                                                                                             |
| attributes.**updated\_at**                                             | `string`  | Time at which the resource was last updated.                                                                                                                                                        |
| attributes.**reference**                                               | `string`  | A string that you can use to add any external identifier to the resource. This can be useful for integrating the resource to an external system, like an ERP, a marketing tool, a CRM, or whatever. |
| attributes.**reference\_origin**                                       | `string`  | Any identifier of the third party system that defines the reference code.                                                                                                                           |
| attributes.**jwt\_custom\_claim**                                      | `object`  | The custom\_claim attached to the current JWT (if any).                                                                                                                                             |
| attributes.**metadata**                                                | `object`  | Set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the resource in a structured format.                                        |
| attributes.**\_request\_anonymization**                                | `boolean` | Send this attribute if you want to trigger anonymization. Cannot be passed by sales channels.                                                                                                       |
| attributes.**\_cancel\_anonymization**                                 | `boolean` | Send this attribute if you want to trigger a cancellation of anonymization. Cannot be passed by sales channels.                                                                                     |
| attributes.**anonymization\_info**                                     | `object`  | The anonymization info object.                                                                                                                                                                      |
| attributes.anonymization\_info.**status**                              | `string`  | The status of the anonymization.                                                                                                                                                                    |
| attributes.anonymization\_info.**requested\_at**                       | `string`  | The time when the anonymization was requested.                                                                                                                                                      |
| attributes.anonymization\_info.**started\_at**                         | `string`  | The time when the anonymization request was started.                                                                                                                                                |
| attributes.anonymization\_info.**completed\_at**                       | `string`  | The time when the anonymization request was completed.                                                                                                                                              |
| attributes.anonymization\_info.**failed\_at**                          | `string`  | The time when the anonymization request failed.                                                                                                                                                     |
| attributes.anonymization\_info.**cancelled\_at**                       | `string`  | The time when the anonymization request was cancelled.                                                                                                                                              |
| attributes.anonymization\_info.**requester**                           | `object`  | The user who requested the anonymization.                                                                                                                                                           |
| attributes.anonymization\_info.requester.**id**                        | `string`  | The ID of the user.                                                                                                                                                                                 |
| attributes.anonymization\_info.requester.**first\_name**               | `string`  | First name of the user.                                                                                                                                                                             |
| attributes.anonymization\_info.requester.**last\_name**                | `string`  | Last name of the user.                                                                                                                                                                              |
| attributes.anonymization\_info.requester.**email**                     | `string`  | Email of the user.                                                                                                                                                                                  |
| attributes.anonymization\_info.**cancellation\_requester**             | `object`  | The user who requested the cancellation of the anonymization.                                                                                                                                       |
| attributes.anonymization\_info.cancellation\_requester.**id**          | `string`  | The ID of the user.                                                                                                                                                                                 |
| attributes.anonymization\_info.cancellation\_requester.**first\_name** | `string`  | First name of the user.                                                                                                                                                                             |
| attributes.anonymization\_info.cancellation\_requester.**last\_name**  | `string`  | Last name of the user.                                                                                                                                                                              |
| attributes.anonymization\_info.cancellation\_requester.**email**       | `string`  | Email of the user.                                                                                                                                                                                  |
| attributes.**anonymization\_status**                                   | `string`  | Status of the current anonymization request (if any). One of 'requested', 'started', 'completed', 'failed', or 'cancelled'.                                                                         |
| relationships.**customer\_group**                                      | `object`  | The group to which this customer belongs (optional).                                                                                                                                                |
| relationships.**customer\_addresses**                                  | `array`   | The customer's saved addresses, i.e. their address book.                                                                                                                                            |
| relationships.**customer\_payment\_sources**                           | `array`   | The customer's saved credit cards, i.e. their wallet.                                                                                                                                               |
| relationships.**customer\_subscriptions**                              | `array`   | The customer's subscriptions.                                                                                                                                                                       |
| relationships.**orders**                                               | `array`   | The customer's orders, either pending or placed.                                                                                                                                                    |
| relationships.**order\_subscriptions**                                 | `array`   | The customer's order subscriptions.                                                                                                                                                                 |
| relationships.**returns**                                              | `array`   | The customer's returns, either pending or shipped.                                                                                                                                                  |
| relationships.**sku\_lists**                                           | `array`   | The associated SKU lists.                                                                                                                                                                           |
| relationships.**attachments**                                          | `array`   | The associated attachments.                                                                                                                                                                         |
| relationships.**events**                                               | `array`   | The associated events.                                                                                                                                                                              |
| relationships.**tags**                                                 | `array`   | The associated tags. Cannot be passed by sales channels.                                                                                                                                            |
| relationships.**jwt\_customer**                                        | `object`  | The customer associated to the JWT.                                                                                                                                                                 |
| relationships.**jwt\_markets**                                         | `array`   | The markets associated to the JWT.                                                                                                                                                                  |
| relationships.**jwt\_stock\_locations**                                | `array`   | The stock locations associated to the JWT.                                                                                                                                                          |
| relationships.**event\_stores**                                        | `array`   | The associated event stores.                                                                                                                                                                        |
| meta.**mode**                                                          | `string`  | The resource environment (can be one of `test` or `live`)                                                                                                                                           |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.commercelayer.io/core-api-reference/customers/object.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
