This commit is contained in:
seb
2026-10-15 20:14:54 +02:00
parent e462a3d250
commit 508e1b6d7a
18 changed files with 859 additions and 333 deletions

View File

@@ -5,8 +5,10 @@ Protected. Requires a valid session cookie (`credentials: 'include'`).
Create order from quote
Creates a sales order from an existing quote for the authenticated user's selected company.
Copies lines, customer entity, and external number from the quote unless explicitly overridden.
Copies lines and customer entity from the quote.
Sets external reference (externalNumber) to the quote number unless explicitly overridden.
If the order number is omitted, it is auto-allocated from the sequence.
Fails with 400 (No entity selected) if neither the quote nor the request body specifies a customer entity.
## Path parameters
@@ -23,7 +25,7 @@ If the order number is omitted, it is auto-allocated from the sequence.
| `date` | no | string | Optional order date (ISO format). Defaults to current date. |
| `createdAt` | no | string | Optional creation timestamp. |
| `entityId` | no | integer | Customer entity ID override. Defaults to quote's entityId. |
| `externalNumber` | no | string | External customer reference override. Defaults to quote's externalNumber. |
| `externalNumber` | no | string | External customer reference override. Defaults to quote's number. |
| `lines` | no | ManifestLineInput[] | Optional line items override. Defaults to quote's lines. |
```json
@@ -170,7 +172,8 @@ Created order
"thumby": 1,
"meta": {}
}
]
],
"state": "new"
}
],
"files": [
@@ -199,7 +202,7 @@ Created order
| Status | Description |
|--------|-------------|
| 400 | No company selected, invalid quote id, or invalid order data — `{"error":"…"}` |
| 400 | No company selected, no entity selected, invalid quote id, or invalid order data — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Not authorized for company — `{"error":"…"}` |
| 404 | Quote not found or entity not found — `{"error":"…"}` |