1.3 KiB
1.3 KiB
POST /order/{id}/pdf
Protected. Requires a valid session cookie (credentials: 'include').
Generate and attach order PDF
Generates an A4 PDF document for the sales order with line items, prices, and tax breakdown.
Attaches the PDF as a manifestattachment to the order so it can be printed or archived.
Path parameters
| Param | Required | Type | Description |
|---|---|---|---|
id |
yes | integer | Order ID |
Signals
On success, emits SSE signal: order (see GET /events).
Response 201
PDF generated and attached to order
{
"attachment": {
"id": 1,
"manifestId": 1,
"fileId": 1,
"sort": 1,
"hash": "…",
"mimetype": "…",
"name": "…",
"size": 1,
"created": "2026-08-10T00:00:00.000Z",
"modified": "2026-08-10T00:00:00.000Z",
"skeledash": "…",
"thumbx": 1,
"thumby": 1,
"meta": {}
},
"fileUrl": "/order/1/file/5"
}
Errors
| Status | Description |
|---|---|
| 400 | Invalid ID or no company selected — {"error":"…"} |
| 401 | Unauthorized — {"error":"…"} |
| 403 | Not authorized — {"error":"…"} |
| 404 | Order not found — {"error":"…"} |
Generated from @openapi JSDoc. Do not edit by hand — run npm run docs:api.