Orders API
Manage orders programmatically.
Overview
The Orders API lets you manage orders programmatically. All admin endpoints are under /api/admin/orders.
Endpoints
| Method | Path | Description |
|---|---|---|
GET | /api/admin/orders | List orders with pagination and filters |
POST | /api/admin/orders | Create a manual order |
GET | /api/admin/orders/[id] | Get order details with line items |
PATCH | /api/admin/orders/[id] | Update order status, assign sales rep |
DELETE | /api/admin/orders/[id] | Delete an order (Owner only) |
Query parameters
searchβ search by order number, customer name, or emailstatusβ filter by order statusexcludeStatusβ exclude specific statusessourceβ filter by order sourcepageandlimitβ pagination
Creating orders via API
When creating an order via API, you can specify:
- Customer (by ID or create inline)
- Line items with product variants and quantities
- Order source (IN_PERSON, PRIVATE_COMMISSION, etc.)
- Sales rep assignment
- Custom order date (for backdating)
- Notes and tags
