u
This commit is contained in:
58
docs/api/routes/order/_id/pdf.md
Normal file
58
docs/api/routes/order/_id/pdf.md
Normal file
@@ -0,0 +1,58 @@
|
||||
# `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`](../events.md)).
|
||||
|
||||
## Response `201`
|
||||
|
||||
PDF generated and attached to order
|
||||
|
||||
```json
|
||||
{
|
||||
"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",
|
||||
"thumbavif": "…",
|
||||
"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`._
|
||||
Reference in New Issue
Block a user