Production API
The production API handles order creation, status updates, and fulfillment tracking.Endpoints
| Method | Endpoint | Description |
|---|---|---|
| POST | /api/production | Create new order |
| GET | /api/production/[id] | Get order details |
| PATCH | /api/production/[id] | Update order (ops) |
Create Order
Request
Example
Response
Get Order
Response
Example
Update Order (Ops Only)
Request
Example
Order Flow
1
Checkout
User submits order → redirected to Stripe
2
Payment
Stripe processes payment → webhook fires
3
Order Created
Webhook creates order with “submitted” status
4
Production
Ops team processes through status flow
5
Fulfillment
Order marked “fulfilled” → user notified
Webhook Integration
Stripe webhook creates orders on payment:Status Updates
Status changes create fulfillment events:Realtime Subscriptions
Subscribe to order updates:Line Items
Create
Included in order creation via webhook.Schema
Fulfillment Events
Event history for audit trail:Error Responses
| Status | Error | Description |
|---|---|---|
| 400 | ”Invalid request” | Missing required fields |
| 401 | ”Unauthorized” | No valid session |
| 403 | ”Forbidden” | Not order owner (or not ops for update) |
| 404 | ”Order not found” | Invalid order ID |
| 500 | ”Internal error” | Database or Stripe error |
Ops Dashboard
Operators access all orders at/ops/orders:
- Filter by status, priority, date
- Bulk status updates
- Add notes and messages
- View order details
- Track fulfillment progress