# customers

> Shoplazza CLI customers commands: the +search shortcut plus API commands for creating and updating customer records and managing their addresses.

Manage customers and their addresses. Includes 3 shortcut commands and 11 API commands.

## Shortcuts

### +search

Search customers by email, phone, or signup date range. Returns one page; follow `has_more`/`cursor` for the rest.

```shell
shoplazza customers +search [flags]
```

| Flag | Type | Description |
|------|------|-------------|
| `--email` | string | Filter by email |
| `--phone` | string | Filter by phone (matches the customer's primary contact) |
| `--since` | string | Created-at lower bound (ISO date or unix timestamp) |
| `--until` | string | Created-at upper bound (ISO date or unix timestamp) |
| `--page-limit` | int | Page size (1–250) |

```shell
shoplazza customers +search
shoplazza customers +search --email test@example.com
shoplazza customers +search --phone "+1234567890"
shoplazza customers +search --since 2026-01-01 --page-limit 50
```

### +count

Count all customers in the store. The count endpoint takes no filters; to count a filtered subset, use `+search`.

```shell
shoplazza customers +count
```

### +create

Create a new customer.

```shell
shoplazza customers +create [flags]
```

| Flag | Type | Description |
|------|------|-------------|
| `--email` | string | Email (exactly one of `--email` or `--phone`) |
| `--phone` | string | Phone (exactly one of `--email` or `--phone`) |
| `--first-name` | string | First name |
| `--last-name` | string | Last name |
| `--tags` | string | Tags (comma-separated) |
| `--no-marketing` | bool | Opt out of marketing (default: subscribed) |

```shell
shoplazza customers +create --email test@example.com
shoplazza customers +create --phone "+1234567890"
shoplazza customers +create --email test@example.com --first-name John --last-name Doe \
  --tags "vip,wholesale"
```

## API commands

All dynamic API commands share these flags:

| Flag | Short | Description |
|------|-------|-------------|
| `--params` | | Path/query parameters as JSON |
| `--data` | | Request body as JSON (inline, `@file`, or `-` for stdin); only on commands that take a request body |
| `--jq` | `-q` | jq expression to filter output |
| `--dry-run` | | Preview the request without executing |



```shell
shoplazza customers list
shoplazza customers get --params '{"customer_id":"123"}'
shoplazza customers create --data @customer.json
shoplazza customers update --params '{"customer_id":"123"}' --data @customer.json
shoplazza customers count
```

### customers addresses

```shell
shoplazza customers addresses list --params '{"customer_id":"123"}'
shoplazza customers addresses get --params '{"customer_id":"123","address_id":"456"}'
shoplazza customers addresses create --params '{"customer_id":"123"}' --data @address.json
shoplazza customers addresses update --params '{"customer_id":"123","address_id":"456"}' --data @address.json
shoplazza customers addresses delete --params '{"customer_id":"123","address_id":"456"}'
shoplazza customers addresses set-default --params '{"customer_id":"123","address_id":"456"}'
```

## Schema introspection

```shell
shoplazza schema customers
shoplazza schema customers.addresses.create
```
