1.3 KiB
1.3 KiB
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)
| Field | Required | Type | Description |
|---|---|---|---|
address |
yes | string | Printer network address or hostname |
type |
yes | string | Printer type ("esc/pos" for lines, "zpl" for pages, or "ipp") |
model |
no | string | |
serial |
no | string | |
sort |
no | integer | |
desc |
no | string |
{
"address": "…",
"type": "esc/pos",
"model": "…",
"serial": "…",
"sort": 1,
"desc": "…"
}
Signals
On success, emits SSE signal: printer (see GET /events).
Response 201
Created printer
{
"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.