Guides › ERP label printing with ZPL

ERP label printing with ZPL

Published:

ERP systems are good at knowing what should be on a label and weak at knowing whether the label will physically print. The gap shows up in the same place every time: a template edited on a Tuesday, a shift that starts on Wednesday, and a pallet of labels that came out wrong because nothing between the ERP and the printer ever looked at the output.

The pipeline, and where it actually breaks

Whatever the system — Odoo, NetSuite, a homegrown WMS — the shape is the same: business data is merged into a label template, the result is emitted as ZPL, and the ZPL is delivered to a printer, usually raw over TCP port 9100. Three failure points sit in that chain and none of them is the printer's fault:

  1. Merge produces content the layout cannot hold. A product name that is twice as long as the test record, an address with a fourth line, a batch code with more digits than expected. The template was never wrong for the data it was designed against.
  2. The template was drawn for a different printer. Coordinates in ZPL are dots; a layout built against a 203 dpi device prints at roughly two-thirds size on a 300 dpi head. Warehouses acquire printers over years and rarely all at once.
  3. Nothing validates before sending. Port 9100 has no undo: the printer moves media the moment bytes arrive, so the first indication of a bad merge is a physical stack of bad labels.

The validation gate

The fix is a step, not a product: between "ERP produced ZPL" and "send to printer", run a structural check and refuse to queue anything that fails. In practice that means one HTTP call in whatever service already handles the printing.

curl -X POST "https://api.labelixa.com/v1/diagnostics?dpmm=8&w=4&h=6"      --data-binary @merged-label.zpl

The response lists findings with severity and position. Treat error as a hard stop — the label will not render as intended — and log warning even when you proceed, because warnings are what turn into "why did last month's labels scan worse" questions. The same gate exists as a command line step for a cron or CI job (npx labelixa validate merged-label.zpl exits non-zero on errors), which is the easiest way to check a template against a batch of real records before a release.

Rendering is the second half. A gate catches structural problems; a render shows the human what the label will look like, which is what you want when a template changes and someone has to approve it.

Odoo

Odoo's label output is template-driven and can be emitted as ZPL to a network printer. The practical advice is independent of version: keep the ZPL template in version control rather than only in the database, test it against your longest real values (not the demo data), and put the validation gate in the same code path that sends to the printer. Because Odoo deployments differ so much between versions and modules, confirm the exact configuration screens against your own version's documentation rather than a screenshot from another release.

NetSuite

NetSuite generates label output from saved searches and scripts, so the label is assembled where business logic lives. That makes it easy to add a validation step in the same script that produces the ZPL, and it makes the "longest real value" test especially important: a saved search that works on today's data can produce an overflowing label the first time a longer item name appears. As with Odoo, treat the exact record and script setup as version-specific and check it against current documentation.

What to test before a release

If a label still prints wrong after all three, the symptom triage narrows it to a cause without spending media on guesses.

Related guides

What is ZPL?

ZPL is the language Zebra thermal printers understand. How to read the commands, how a label is put together, and the most common mistakes.

Which barcode symbology should I use?

EAN-13, Code 128 or QR? Practical rules for picking a barcode based on your data, your space and the scanner that has to read it.

How to preview a ZPL file without a printer

A ZPL file is just text — the label only exists once something draws it. Three practical ways to see a ZPL label before it reaches the printer.

Try your own ZPL code →