E149: Add item to sales order
POST /api/sales-orders/:id/items
Appends a new line to an existing SO. Triggered from Sales Order Detail items section. Each SKU can appear at most once per order.
Authentication
Standard tenant route. Requires Authorization: Bearer <firebase-id-token> and X-Org-Id: <org-id>. Access: Member.
Request
{ "skuId": "uuid", "quantity": 50, "unitPrice": 48.00 }
unitPrice is optional. No FG-ledger entries are written here; ledger side effects on item changes are a v1 gap (the initial entries are written by W144).
Response — 201 Created
{ "id": "uuid", "soId": "uuid", "skuId": "uuid", "quantity": 50, "unitPrice": 48.00, "allocatedQuantity": 50, "shippedQuantity": 0 }
Errors
| HTTP | code | Condition |
|---|---|---|
| 404 | not_found | SO or SKU not found. |
| 409 | conflict | The SKU is already on this sales order (L1 UNIQUE (sales_order_id, sku_id)). |
| 422 | validation_failed | Shape invalid. |
Workflow
Calls W149 Add item to sales order.