Files
dashback/docs/api/routes/quote/_id/pdf.md
2026-10-15 00:30:23 +02:00

59 lines
1.3 KiB
Markdown

# `POST /quote/{id}/pdf`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Generate and attach quote PDF
Generates an A4 PDF document for the quote with prices, net sum, and tax breakdown.
Stores the PDF as a `manifestattachment` for printing or downloading.
## Path parameters
| Param | Required | Type | Description |
|-------|----------|------|-------------|
| `id` | yes | integer | Quote ID |
## Signals
On success, emits SSE signal: `quote` (see [`GET /events`](../events.md)).
## Response `201`
PDF generated and attached to quote
```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": "/quote/1/file/5"
}
```
## Errors
| Status | Description |
|--------|-------------|
| 400 | Invalid ID or no company selected — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Not authorized — `{"error":"…"}` |
| 404 | Quote not found — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._