60 lines
1.4 KiB
Markdown
60 lines
1.4 KiB
Markdown
# `POST /shipment/{id}/pdf`
|
|
|
|
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
|
|
|
Generate and attach shipment PDF (delivery note)
|
|
|
|
Generates an A4 delivery note PDF document for the shipment with line items and package tracking.
|
|
Shipping slips contain no price information.
|
|
Attaches the PDF as a `manifestattachment` to the shipment so it can be printed or attached to packages.
|
|
|
|
|
|
## Path parameters
|
|
|
|
| Param | Required | Type | Description |
|
|
|-------|----------|------|-------------|
|
|
| `id` | yes | integer | Shipment ID |
|
|
|
|
## Signals
|
|
|
|
On success, emits SSE signal: `shipment` (see [`GET /events`](../events.md)).
|
|
|
|
## Response `201`
|
|
|
|
PDF generated and attached to shipment
|
|
|
|
```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",
|
|
"skeledash": "…",
|
|
"thumbx": 1,
|
|
"thumby": 1,
|
|
"meta": {}
|
|
},
|
|
"fileUrl": "/shipment/1/file/5"
|
|
}
|
|
```
|
|
|
|
## Errors
|
|
|
|
| Status | Description |
|
|
|--------|-------------|
|
|
| 400 | Invalid ID or no company selected — `{"error":"…"}` |
|
|
| 401 | Unauthorized — `{"error":"…"}` |
|
|
| 403 | Not authorized — `{"error":"…"}` |
|
|
| 404 | Shipment not found — `{"error":"…"}` |
|
|
|
|
---
|
|
|
|
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|