Skip to main content
Version: v1.0.0(int)

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

HTTPcodeCondition
404not_foundSO or SKU not found.
409conflictThe SKU is already on this sales order (L1 UNIQUE (sales_order_id, sku_id)).
422validation_failedShape invalid.

Workflow

Calls W149 Add item to sales order.