u
This commit is contained in:
60
docs/api/routes/zpljob.md
Normal file
60
docs/api/routes/zpljob.md
Normal file
@@ -0,0 +1,60 @@
|
||||
# `POST /zpljob`
|
||||
|
||||
Protected. Requires a valid session cookie (`credentials: 'include'`).
|
||||
|
||||
Create ZPL print job
|
||||
|
||||
Issues a new ZPL print job to an agent printer. If copiescount > 1, the ZPL quantity command (^PQ)
|
||||
is automatically applied. The connected printer agent receives an immediate real-time event.
|
||||
|
||||
|
||||
## Body (JSON)
|
||||
|
||||
| Field | Required | Type | Description |
|
||||
|-------|----------|------|-------------|
|
||||
| `agentprinterId` | yes | integer | Target agent printer ID |
|
||||
| `copiescount` | no | integer | Optional copy count (defaults to 1) |
|
||||
| `data` | yes | string | Raw ZPL string |
|
||||
|
||||
```json
|
||||
{
|
||||
"agentprinterId": 1,
|
||||
"copiescount": 2,
|
||||
"data": "^XA^FO50,50^ADN,36,20^FDHello Zebra^FS^XZ"
|
||||
}
|
||||
```
|
||||
|
||||
## Signals
|
||||
|
||||
On success, emits SSE signal: `printerjob` (see [`GET /events`](../events.md)).
|
||||
|
||||
## Response `201`
|
||||
|
||||
Print job created
|
||||
|
||||
```json
|
||||
{
|
||||
"printerjob": {
|
||||
"id": 1,
|
||||
"agentprinterId": 1,
|
||||
"printeragentId": 1,
|
||||
"type": "zpl",
|
||||
"state": "pending",
|
||||
"data": "…",
|
||||
"createdAt": "2026-08-10T00:00:00.000Z",
|
||||
"completedAt": "2026-08-10T00:00:00.000Z"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Errors
|
||||
|
||||
| Status | Description |
|
||||
|--------|-------------|
|
||||
| 400 | Invalid input or missing fields — `{"error":"…"}` |
|
||||
| 401 | Unauthorized — `{"error":"…"}` |
|
||||
| 404 | Agent printer not found — `{"error":"…"}` |
|
||||
|
||||
---
|
||||
|
||||
_Generated from `@openapi` JSDoc. Do not edit by hand — run `npm run docs:api`._
|
||||
Reference in New Issue
Block a user