# Customers

Section: Customers. Part of the [API reference](https://developer.yoprint.com/reference.md). Web page: https://developer.yoprint.com/reference/customers/

This page and all 23 operation pages, in 7 files: https://developer.yoprint.com/llms/customers.txt (operation 1), https://developer.yoprint.com/llms/customers-2.txt (operations 2 to 4), https://developer.yoprint.com/llms/customers-3.txt (operations 5 to 7), https://developer.yoprint.com/llms/customers-4.txt (operations 8 to 10), https://developer.yoprint.com/llms/customers-5.txt (operations 11 to 12), https://developer.yoprint.com/llms/customers-6.txt (operations 13 to 17), https://developer.yoprint.com/llms/customers-7.txt (operations 18 to 23)

The people and companies you sell to. A customer holds contacts, billing and shipping addresses, brand profiles, files, tags and a customer credit balance; sales orders, quotes and invoices name a customer.

## Operations (22)

- [Create a customer](https://developer.yoprint.com/reference/customers/v1-customer-store.md): `POST /v1/api/store/{team_slug}/customer`. Creates a customer, with its contacts and its billing and shipping addresses, in one request.
- [Create or update a customer by contact](https://developer.yoprint.com/reference/customers/v1-customer-upsert.md): `POST /v1/api/store/{team_slug}/customer/upsert`. Finds a customer by one contact's email or phone and updates it, or creates a new customer with that contact.
- [List customers](https://developer.yoprint.com/reference/customers/v1-customer-index.md): `GET /v1/api/store/{team_slug}/customer`. Lists the team's customers, without deleted and system customers.
- [List a customer's tags](https://developer.yoprint.com/reference/customers/v1-customer-tag-index.md): `GET /v1/api/store/{team_slug}/customer/{hash_id}/tag`. Lists the tags on the customer, each with `id`, `name` and `color_hex`.
- [List the users assigned to a customer](https://developer.yoprint.com/reference/customers/v1-customer-assign-index.md): `GET /v1/api/store/{team_slug}/customer/{id}/assign`. Lists the team members assigned to the customer.
- [Search customers with filters](https://developer.yoprint.com/reference/customers/v1-customer-filter.md): `POST /v1/api/store/{team_slug}/customer/filter`. Lists customers that match every filter you send, sorted the way you ask.
- [Get a customer](https://developer.yoprint.com/reference/customers/v1-customer-show.md): `GET /v1/api/store/{team_slug}/customer/{hash_id}`. Returns one customer, deleted ones included (`trashed`), with its `contacts` (deleted ones included), `addresses` (current and old copies), `customer_profiles`, `assigned_users`, `tags` and `media`.
- [Get a customer's order counts and recent activity](https://developer.yoprint.com/reference/customers/v1-customer-activity-summary.md): `GET /v1/api/store/{team_slug}/customer/{hash_id}/activity_summary`. Counts the customer's published sales orders, quotes and invoices, whatever their status (completed ones included), and lists its 10 newest sales orders and quotes.
- [Get the QuickBooks customer linked to a customer](https://developer.yoprint.com/reference/customers/v1-customer-external-id-get.md): `GET /v1/api/store/{team_slug}/customer/{hash_id}/external_id/{id}`. Reads the QuickBooks Online customer linked to this YoPrint customer, for the QuickBooks connection `{id}`.
- [Update a customer](https://developer.yoprint.com/reference/customers/v1-customer-update-put.md): `PUT /v1/api/store/{team_slug}/customer/{hash_id}`. Changes the customer's own fields.
- [Update a customer (PATCH)](https://developer.yoprint.com/reference/customers/v1-customer-update-patch.md): `PATCH /v1/api/store/{team_slug}/customer/{hash_id}`. Changes the customer's own fields.
- [Set a custom Customer Portal ID](https://developer.yoprint.com/reference/customers/v1-customer-customer-portal-token-override-update.md): `PATCH /v1/api/store/{team_slug}/customer/{hash_id}/customer_portal_token_override`. Sets the Customer Portal ID shown for this customer (`display_customer_portal_id`) to a value you choose, and returns the customer with `contacts`.
- [Link a customer to a QuickBooks customer](https://developer.yoprint.com/reference/customers/v1-customer-external-id-update.md): `PUT /v1/api/store/{team_slug}/customer/{hash_id}/external_id/{id}`. Links this YoPrint customer to an existing QuickBooks Online customer, so YoPrint syncs it to that QuickBooks customer.
- [Recalculate a customer's totals](https://developer.yoprint.com/reference/customers/v1-customer-recount.md): `PATCH /v1/api/store/{team_slug}/customer/{hash_id}/recount`. Recalculates the customer's `last_ordered_date`, `ordered_amount`, `unpaid_amount`, `deposit_due_amount`, `overdue_amount` and `quote_amount` from its orders now, and returns the customer.
- [Tag a customer](https://developer.yoprint.com/reference/customers/v1-customer-tag-attach.md): `PUT /v1/api/store/{team_slug}/customer/{hash_id}/tag/attach`. Puts one of your team's tags on the customer and returns the customer's tags.
- [Assign or unassign a user on a customer](https://developer.yoprint.com/reference/customers/v1-customer-assign-update.md): `PUT /v1/api/store/{team_slug}/customer/{id}/assign`. Adds a team member to the customer's assigned users (`action: assign`) or removes one (`action: unassign`), and returns the assigned users.
- [Delete a customer](https://developer.yoprint.com/reference/customers/v1-customer-destroy.md): `DELETE /v1/api/store/{team_slug}/customer/{hash_id}`. Deletes a customer.
- [Remove a custom Customer Portal ID](https://developer.yoprint.com/reference/customers/v1-customer-customer-portal-token-override-delete.md): `DELETE /v1/api/store/{team_slug}/customer/{hash_id}/customer_portal_token_override`. Clears the custom Customer Portal ID, so the generated one is shown again, and returns the customer with `contacts`.
- [Unlink a customer from QuickBooks](https://developer.yoprint.com/reference/customers/v1-customer-external-id-delete.md): `DELETE /v1/api/store/{team_slug}/customer/{hash_id}/external_id/{id}`. Removes the link between this customer and its QuickBooks Online customer for the connection `{id}`.
- [Remove a tag from a customer](https://developer.yoprint.com/reference/customers/v1-customer-tag-detach.md): `PUT /v1/api/store/{team_slug}/customer/{hash_id}/tag/detach`. Takes one tag off the customer and returns the customer's tags.
- [Remove every tag from a customer](https://developer.yoprint.com/reference/customers/v1-customer-tag-detach-all.md): `PATCH /v1/api/store/{team_slug}/customer/{hash_id}/tag/detach_all`. Takes all tags off the customer and answers with an empty list.
- [Restore a deleted customer](https://developer.yoprint.com/reference/customers/v1-customer-restore.md): `PATCH /v1/api/store/{team_slug}/customer/{hash_id}/restore`. Brings back a deleted customer.

## Legacy and internal operations (1)

Prefer the operations above. Legacy ones name their replacement; internal ones are built for YoPrint's own apps.

- [Get a customer portal sign-in token](https://developer.yoprint.com/reference/customers/v1-customer-token-exchange.md): `PATCH /v1/api/store/{team_slug}/customer/{hash_id}/token_exchange` (internal: built for YoPrint's own apps, don't build on it). This is a credential: don't log or share it.
