Files
dashback/docs/api/routes/printer/create.md
2026-09-27 16:47:35 +02:00

54 lines
893 B
Markdown

# `POST /printer`
Protected. Requires a valid session cookie (`credentials: 'include'`).
Create printer
Creates a new printer for the selected company.
`type` must be `"esc/pos"` (lines), `"zpl"` (pages), or `"ipp"`.
## Body (JSON)
```json
{
"address": "…",
"type": "esc/pos",
"model": "…",
"serial": "…",
"sort": 1,
"desc": "…"
}
```
## Response `201`
Created printer
```json
{
"printer": {
"id": 1,
"company_id": 1,
"address": "…",
"type": "esc/pos",
"model": "…",
"serial": "…",
"sort": 1,
"desc": "…"
}
}
```
## Errors
| Status | Description |
|--------|-------------|
| 400 | Invalid input or missing fields — `{"error":"…"}` |
| 401 | Unauthorized — `{"error":"…"}` |
| 403 | Not authorized — `{"error":"…"}` |
---
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._