u
This commit is contained in:
53
docs/api/routes/printer/create.md
Normal file
53
docs/api/routes/printer/create.md
Normal file
@@ -0,0 +1,53 @@
|
||||
# `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) or `"zpl"` (pages).
|
||||
|
||||
|
||||
## 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`._
|
||||
Reference in New Issue
Block a user