# Customers

> Who a YoPrint shop works for, a customer with contacts, addresses and brand profiles, the defaults new orders take from it, the money on its account, and how its contacts reach the Customer Portal.

Web page: https://developer.yoprint.com/how-yoprint-works/customers/

A **customer** is a company or a person the shop works for: YoPrint treats both the same way. A quote or sales order belongs to one customer, and needs one before it can be published. In the web app: **Customers**.

## What a customer holds

**Diagram:** A customer's defaults fill in each new order. The order can change them afterwards.

- **Customer**, with tags, assigned team members and internal notes
  - **Contacts**: the people, at most one of them primary
  - **Addresses**: billing and shipping, one of each primary
  - **Brand profiles**: the name, logo, contact details and Ship From address its documents and shipments use
  - **Defaults for new orders**: brand profile, pricing group, payment terms and warehouse
  - **Store credit**, with its history
  - **Quotes and sales orders**

## Contacts

A contact is a person at the customer, with an email address and phone number. At most one contact is **primary**. A customer can have none until you choose one.

Contacts sign in to the **Customer Portal** with a one-time code sent to their email address, or with a password once they've set one. Two contacts of one customer can't share an email address, except on customers synced from Shopify.

## The defaults a customer gives an order

| Default       | What it decides                                                                          |
| ------------- | ---------------------------------------------------------------------------------------- |
| Brand profile | The primary one: the name and Ship From address the order's documents and shipments use. |
| Pricing group | How products are priced. Without one, the order takes the team's default.                |
| Payment terms | The deposit and when payment is due. Without them, the team's default.                   |
| Warehouse     | The shop location whose stock the order uses. Without one, the team's default.           |

Two settings stay on the customer and are read when they're needed, not copied to the order:

- **Tax exempt**: checked each time YoPrint works out an invoice's tax.
- **Third-party billing**: whether the customer's new shipping labels and rates start on its own carrier account.

A team works in one currency. A customer's `wallet_currency`, the currency its store credit is held in, is the team's default.

## Money on a customer

The customer's record adds up its orders: what's unpaid, what's overdue, deposits due, and the value of its quotes and orders. A **balance statement** (`pdf.invoice_statement`) is a PDF of the customer's unpaid invoices.

**Store credit** is a balance the customer can spend on orders. The shop adds to it, and so do refunds. The API calls it customer credit, and the balance is `wallet_fund`. Adding or taking out credit by hand fires `customer_credit.deposited` or `customer_credit.withdrew`. Spending credit on an order, or refunding to credit, doesn't.

## Vendors are separate

A **vendor** is a supplier the shop buys from, not a customer. Vendors have contacts too, and receive purchase orders. See [Purchasing and stock](https://developer.yoprint.com/how-yoprint-works/purchasing-and-stock.md).

## Events

Customers and their contacts fire `customer.created`, `customer.updated` and `customer.deleted`, and `customer_contact.created`, `customer_contact.updated` and `customer_contact.deleted`. Deleting a vendor's contact through the shared contact operation fires `customer_contact.deleted` too.

## In the API

[Create and sync customers](https://developer.yoprint.com/guides/customers-and-contacts.md): Create, find, upsert and update customers and contacts.

[Customers reference](https://developer.yoprint.com/reference/customers.md): Customers, with their contacts, addresses, brand profiles and store credit under them.
