# POST /api/v1/customers

> Create customer

- **Tag:** customers
- **Operation ID:** `create_customer_api_v1_customers_post`

## Description

Create a new customer record for the business.

## Authentication

Bearer token in `Authorization` header.
Required header: `x-business-id: <business uuid>`.

## Request body

Schema: `CustomerCreateRequest`

- `name` (string · required) — Customer name (person or company).
- `email` (string · email · required) — Customer email for invoices and communications.
- `address` (string) — Customer billing/shipping address.
- `phone` (string) — Customer phone number.
- `tax_id` (string) — Tax identification number (EIN, VAT, etc.).
- `website` (string) — Customer website URL.
- `notes` (string) — Internal notes about this customer.
- `credit_limit_cents` (integer) — Credit limit in cents (e.g., 100000 = $1,000.00).
- `default_payment_term_id` (string) — Default payment term ID for new invoices.
- `status` (CounterpartyStatus) → `CounterpartyStatus` — Customer status (active, inactive, blocked).
- `category` (string) — Business category (e.g., 'Retail', 'Wholesale').
- `invoice_footer` (string) — Custom invoice footer/payment instructions for this customer. Overrides business default.

## Responses

### 201 — Successful Response

Schema: `CustomerResponse`

- `id` (string · required) — Customer UUID.
- `business_id` (string · required) — Business UUID.
- `created_at` (string · date-time · required) — Creation timestamp.
- `updated_at` (string · date-time · required) — Last update timestamp.
- `name` (string · required) — Customer name.
- `email` (string · required) — Customer email.
- `address` (string) — Customer address.
- `phone` (string) — Customer phone number.
- `tax_id` (string) — Tax identification number.
- `website` (string) — Customer website URL.
- `notes` (string) — Internal notes.
- `credit_limit_cents` (integer) — Credit limit in cents.
- `default_payment_term_id` (string) — Default payment term ID.
- `status` (string) — Customer status.
- `category` (string) — Business category.
- `is_deleted` (boolean) — Whether customer is soft deleted.
- `deleted_at` (string · date-time) — Timestamp when customer was deleted.
- `stripe_customer_id` (string) — Linked Stripe customer ID.
- `invoice_footer` (string) — Custom invoice footer/payment instructions for this customer.
- `contacts` (array · CustomerContactResponse) — Customer contacts.

### 400 — Bad Request - Invalid input

### 401 — Unauthorized - Authentication required

### 403 — Forbidden - Insufficient permissions

### 422 — Validation Error

Schema: `HTTPValidationError`

- `detail` (array · ValidationError) → `ValidationError`
  - `loc` (array · string | integer · required)
  - `msg` (string · required)
  - `type` (string · required)
  - `input` (object)
  - `ctx` (object)

## Code samples

### cURL

```bash
curl -X POST 'https://api.ondayzero.com/api/v1/customers' \
  -H 'Authorization: Bearer dz_your_token' \
  -H 'x-business-id: YOUR_BUSINESS_ID' \
  -H 'Content-Type: application/json' \
  -d '{
  "name": "string",
  "email": "string"
}'
```

### JavaScript

```javascript
const response = await fetch('https://api.ondayzero.com/api/v1/customers', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer dz_your_token',
    'x-business-id': 'YOUR_BUSINESS_ID',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
  "name": "string",
  "email": "string"
}),
});
const data = await response.json();
```

### Python

```python
import httpx

headers = {
    "Authorization": "Bearer dz_your_token",
    "x-business-id": "YOUR_BUSINESS_ID",
}

payload = {
  "name": "string",
  "email": "string"
}

response = httpx.post("https://api.ondayzero.com/api/v1/customers", headers=headers, json=payload)
data = response.json()
```

## See also

- HTML version: https://www.ondayzero.com/docs/reference/customers/create-customer
- OpenAPI slice: https://www.ondayzero.com/docs/reference/customers/create-customer/openapi.json
- Other endpoints in **customers**: https://www.ondayzero.com/docs/reference/customers
