# orders

> Shoplazza CLI orders commands: search shortcuts plus API commands for fulfillment, tracking numbers, refunds, cancellations, and logistics on a store.

Manage orders, fulfillments, refunds, and logistics. Includes 5 shortcut commands and 36 API commands.

## Shortcuts

### +search

Search orders by keyword, status, or date range.

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

| Flag | Type | Description |
|------|------|-------------|
| `--keyword` | string | Order number, customer name, email, etc. |
| `--status` | string | Order status: `opened`, `placed`, `finished`, `cancelled` |
| `--financial-status` | string | Financial status: `waiting`, `paying`, `authorized`, `partially_paid`, `paid`, `cancelled`, `failed`, `refunded` |
| `--fulfillment-status` | string | Fulfillment status: `initialled`, `waiting`, `partially_shipped`, `shipped`, `finished`, `cancelled`, `returned` |
| `--customer-id` | string | Filter by customer ID |
| `--since` | string | Start time (ISO date or unix timestamp) |
| `--until` | string | End time (ISO date or unix timestamp) |
| `--page-limit` | int | Page size (1–250) |

```shell
shoplazza orders +search
shoplazza orders +search --keyword "John"
shoplazza orders +search --status opened --financial-status paid
shoplazza orders +search --since 2026-01-01 --until 2026-06-30
shoplazza orders +search --customer-id <id> --page-limit 50
```

### +count

Count orders matching criteria.

```shell
shoplazza orders +count [flags]
```

| Flag | Type | Description |
|------|------|-------------|
| `--status` | string | Order status filter |
| `--financial-status` | string | Financial status filter |
| `--fulfillment-status` | string | Fulfillment status filter |
| `--since` | string | Start time |
| `--until` | string | End time |

```shell
shoplazza orders +count
shoplazza orders +count --status opened --financial-status paid
shoplazza orders +count --since 2026-01-01 --until 2026-06-30
```

### +ship

Create a fulfillment for an order.

```shell
shoplazza orders +ship [flags]
```

| Flag | Type | Required | Description |
|------|------|----------|-------------|
| `--order-id` | string | Yes | Order ID |
| `--tracking` | string | Yes | Tracking number |
| `--company` | string | | Carrier name (e.g. DHL, UPS) |
| `--company-code` | string | | Carrier code |
| `--line-items` | string | | Line item quantities (format: `line-id:qty,...`; defaults to all) |
| `--notify` | bool | | Notify customer |

```shell
shoplazza orders +ship --order-id <id> --tracking 1234567890
shoplazza orders +ship --order-id <id> --tracking 1234567890 --company DHL --notify
shoplazza orders +ship --order-id <id> --tracking 1234567890 --line-items "line1:2,line2:1"
```

### +refund

Create a refund for an order.

```shell
shoplazza orders +refund [flags]
```

| Flag | Type | Required | Description |
|------|------|----------|-------------|
| `--order-id` | string | Yes | Order ID |
| `--amount` | string | Yes | Refund amount (e.g. `29.99`) |
| `--payment-line-id` | string | | Payment line ID (required for multiple payment lines) |
| `--note` | string | | Refund note |
| `--return-items` | bool | | Return items to inventory |

```shell
shoplazza orders +refund --order-id <id> --amount 29.99
shoplazza orders +refund --order-id <id> --amount 29.99 --note "Customer request" --return-items
shoplazza orders +refund --order-id <id> --amount 29.99 --payment-line-id <id>
```

### +update-tracking

Update tracking information for a fulfillment.

```shell
shoplazza orders +update-tracking [flags]
```

| Flag | Type | Required | Description |
|------|------|----------|-------------|
| `--order-id` | string | Yes | Order ID |
| `--fulfillment-id` | string | Yes | Fulfillment ID |
| `--tracking` | string | Yes | New tracking number |
| `--company` | string | | Carrier name |
| `--tracking-url` | string | | Custom tracking URL |
| `--notify` | bool | | Notify customer |

```shell
shoplazza orders +update-tracking --order-id <id> --fulfillment-id <id> --tracking NEW123
shoplazza orders +update-tracking --order-id <id> --fulfillment-id <id> --tracking NEW123 \
  --company UPS --tracking-url "https://..." --notify
```

## API commands

All dynamic API commands share these flags:

| Flag | Short | Description |
|------|-------|-------------|
| `--params` | | Path/query parameters as JSON |
| `--data` | | Request body as JSON |
| `--jq` | `-q` | jq expression to filter output |
| `--dry-run` | | Preview the request without executing |



```shell
shoplazza orders list
shoplazza orders get --params '{"order_id":"123"}'
shoplazza orders get-by-number --params '{"number":"1001"}'
shoplazza orders create --data @order.json
shoplazza orders update --params '{"order_id":"123"}' --data @order.json
shoplazza orders delete --params '{"order_id":"123"}'
shoplazza orders cancel --params '{"order_id":"123"}'
shoplazza orders pay --params '{"order_id":"123"}'
shoplazza orders count
```

### orders fulfillments

```shell
shoplazza orders fulfillments list --params '{"order_id":"123"}'
shoplazza orders fulfillments get --params '{"order_id":"123","fulfillment_id":"456"}'
shoplazza orders fulfillments create --params '{"order_id":"123"}' --data @fulfillment.json
shoplazza orders fulfillments update --params '{"order_id":"123","fulfillment_id":"456"}' --data @fulfillment.json
shoplazza orders fulfillments complete --params '{"order_id":"123","fulfillment_id":"456"}'
shoplazza orders fulfillments cancel --params '{"order_id":"123","fulfillment_id":"456"}'
shoplazza orders fulfillments count --params '{"order_id":"123"}'
```

### orders refunds

```shell
shoplazza orders refunds list --params '{"order_id":"123"}'
shoplazza orders refunds list-by-order --params '{"order_id":"123"}'
shoplazza orders refunds create --data @refund.json
shoplazza orders refunds count
```

### orders post-sales

```shell
shoplazza orders post-sales list
shoplazza orders post-sales delete --params '{"id":"123"}'
```

### orders risks

```shell
shoplazza orders risks list --params '{"order_id":"123"}'
shoplazza orders risks get --params '{"order_id":"123","risk_id":"456"}'
shoplazza orders risks create --params '{"order_id":"123"}' --data @risk.json
shoplazza orders risks update --params '{"order_id":"123","risk_id":"456"}' --data @risk.json
shoplazza orders risks delete --params '{"order_id":"123","risk_id":"456"}'
```

### orders transactions

```shell
shoplazza orders transactions list --params '{"order_id":"123"}'
```

### orders shipping-schemas

```shell
shoplazza orders shipping-schemas get-general
shoplazza orders shipping-schemas save-general --data @schema.json
shoplazza orders shipping-schemas create-zone --data @zone.json
shoplazza orders shipping-schemas update-zone --params '{"id":"123"}' --data @zone.json
shoplazza orders shipping-schemas delete-zone --params '{"id":"123"}'
shoplazza orders shipping-schemas get-available-lines
```

### orders tracking-carriers

```shell
shoplazza orders tracking-carriers list
shoplazza orders tracking-carriers detect --data '{"tracking_number":"1234567890"}'
```

## Schema introspection

```shell
shoplazza schema orders
shoplazza schema orders.fulfillments.create
```
