Recommended flow
Capture the exact ZPL payload, preview it, store a PNG/PDF proof with the ticket, then print a final hardware sample only after the cheap checks pass.
Minimal request shape
The browser preview uses a simple ZPL plus density request. Keep generated label data redacted in logs and tickets.
POST /api/preview
Content-Type: application/json
{
"zpl": "^XA...^XZ",
"density": "8"
}Labelary API reference
If you call Labelary directly, send raw ZPL to its REST endpoint with the printer density, label size, and zero-based label index in the URL.
The public service is useful for light automation, but respect its free limits: 3 requests per second, 5000 requests per day, and up to 50 labels per request.
POST http://api.labelary.com/v1/printers/8dpmm/labels/4x6/0/
Content-Type: application/x-www-form-urlencoded
Accept: image/png
^XA...^XZ