Skip to content

POST /print/{target}

Send a print job to a specific printer. Returns a job ID for tracking.

Endpoint:

POST /api/v1/print/{target}
ParameterTypeDescription
targetstringThe printer’s path value from GET /printers, or a tag alias (e.g. tag_LABELS).

Three options for sending print data:

Send the raw print data (ZPL, PDF, etc.) directly as the request body. Always synchronous — blocks until the job completes.

POST /api/v1/print/tcp_192-168-86-250_9100
Content-Type: application/octet-stream
X-API-Key: YOUR_API_KEY
^XA^FO50,50^A0N,50,50^FDHello World^FS^XZ

Send a JSON body with a content field containing a URL to fetch the document from.

POST /api/v1/print/tcp_192-168-86-250_9100
Content-Type: application/json
X-API-Key: YOUR_API_KEY
{
"content": "https://example.com/label.zpl",
"contentType": "raw_url"
}

Send a JSON body with base64-encoded content and print options.

POST /api/v1/print/tag_LABELS
Content-Type: application/json
X-API-Key: YOUR_API_KEY
{
"content": "XlhBXkZPNTAsNTBeQTBOLDUwLDUwXkZESGVsbG8gV29ybGReRlNeWFo=",
"contentType": "raw_base64",
"title": "Shipping Label #1234",
"source": "my-erp",
"options": {
"copies": 2
}
}
FieldTypeRequiredDescription
contentstringYesThe document to print — a URL, base64-encoded data, or a local file path.
contentTypestringRecommendedOne of: pdf_url, pdf_base64, raw_url, raw_base64, zpl, zpl_base64. When omitted, inferred from the content and printer type. New integrations should always set this.
titlestringNoJob name. Passed to CUPS. Defaults to "Untitled".
sourcestringNoIdentifier for the submitting application or user (e.g. "my-erp", "jsmith").
waitbooleanNotrue (default): block until job completes. false: return immediately, poll GET /jobs/{jobId} for status.
optionsobjectNoPrint options (see below). Unsupported options for a given printer are silently ignored.
idempotencyKeystringNoUnique key to prevent duplicate submissions. If a job with this key already exists (within 1-hour TTL), the existing job is returned with HTTP 200.
OptionTypeDescription
copiesnumberNumber of copies. Default 1.
duplexstring"one-sided", "long-edge", or "short-edge".
colorModestring"color", "grayscale", or "auto".
paperSizestringCUPS media name (e.g. "letter", "a4"). Must be in the printer’s mediaSupported.
pageRangestringPage range (e.g. "1-5", "1,3,7-9"). PDF only.
binstringPaper tray / input slot name.
fitToPagebooleanScale content to fit the page. PDF only.
orientationstring"portrait", "landscape", "reverse-landscape", or "reverse-portrait".
qualitystring"draft", "normal", or "high".

Returned when wait is true (default) or for raw binary requests.

{
"status": "success",
"statusCode": 200,
"result": {
"module": "/print/tag_LABELS",
"message": "Printed successfully.",
"content": {
"jobId": "pj_a8f3e1b2",
"printer": "tcp_192-168-86-250_9100",
"target": "tag_LABELS",
"title": "Shipping Label #1234",
"source": "my-erp",
"state": "completed",
"error": null,
"createdAt": "2026-03-28T14:30:00.000Z",
"completedAt": "2026-03-28T14:30:08.500Z"
}
}
}

Returned when wait is false. Poll GET /jobs/{jobId} for the final state.

{
"status": "success",
"statusCode": 201,
"result": {
"module": "/print/tag_LABELS",
"message": "Print job accepted.",
"content": {
"jobId": "pj_a8f3e1b2",
"printer": "tcp_192-168-86-250_9100",
"target": "tag_LABELS",
"title": "Shipping Label #1234",
"source": "my-erp",
"state": "queued",
"error": null,
"createdAt": "2026-03-28T14:30:00.000Z",
"completedAt": null
}
}
}

Returned when the pre-flight status check detects an issue (ZPL printers only). See Pre-flight Status Check for details.

{
"status": "error",
"statusCode": 503,
"result": {
"module": "/print/tcp_192-168-86-250_9100",
"message": "Printer is not ready",
"content": {
"jobId": "pj_c4d5e6f7",
"printer": "tcp_192-168-86-250_9100",
"target": "tcp_192-168-86-250_9100",
"state": "failed",
"error": "Printer not ready: paper out, head open",
"createdAt": "2026-03-28T14:30:00.000Z",
"completedAt": "2026-03-28T14:30:00.500Z"
}
}
}