API Documentation
Help Center/API Documentation/WMS Print Jobs API (Cloud Print)

WMS Print Jobs API (Cloud Print)

Last updated 2026-10-13

Submit cloud print jobs with ZPL, query job status, cancel and retry — the phone-to-hub cloud print relay.

Submit a cloud print job#

A phone web app (no local Hub capability) writes ZPL into print_jobs as queued. The Device Hub on the warehouse workstation subscribes/polls, prints locally on Zebra, and writes back the result. Omit device_id to use the warehouse’s default label printer.

POST /api/wms/print-jobs
POST /api/wms/print-jobs
{
  "device_id": "<uuid>",       // optional; default label printer of the warehouse if omitted
  "warehouse_id": "<uuid>",    // optional; scope for default-printer lookup
  "label_kind": "pallet",      // required: e.g. pallet | carton | ucc
  "ref_type": "pallet",        // optional
  "ref_id": "<uuid>",          // optional
  "copies": 2,                 // optional, default 1
  "zpl_content": "^XA\n^FO40,40^FDHello^FS\n^XZ"   // required
}

Query job status#

GET /api/wms/print-jobs/[id] — phone polling
GET /api/wms/print-jobs/<job-id>
// -> { ok: true, data: {
//   id, status: "queued|printing|done|failed|cancelled",
//   error, device_id, label_kind, copies, created_at } }

GET /api/wms/print-jobs?status=queued&warehouse_id=<uuid>&page=1&page_size=50
// print-center queue list (page_size default 50, max 200)

Job lifecycle: queued → printing → done, or → failed (with error text), or → cancelled. The Hub claims queued jobs atomically (UPDATE … WHERE status='queued'), so a job cancelled on the phone side is never printed.

Cancel / retry#

PATCH /api/wms/print-jobs/[id]
PATCH /api/wms/print-jobs/<job-id>
{ "action": "cancel" }   // only from queued  -> cancelled
{ "action": "retry" }    // only from failed  -> queued (error cleared)
// conditional update: 0 rows affected means the state already changed -> HTTP 409
Cloud relay notes: ZPL passes through the cloud (tenant’s own Supabase, RLS-protected) — migration 211 added the zpl_content column for this. Jobs waiting over 5 minutes are highlighted in Print Center. Device health: GET /api/wms/print-devices; a device is online when last_seen_at is within 2 minutes.