Use case

Shipping labels: what goes on them and how they print

A shipping label tells people and machines where one parcel is going and which parcel it is. This page covers what is on it, which barcodes it typically carries and why, the data it needs and how it reaches the printer. It describes shipping labels in general: whoever receives or carries the parcel sets the exact layout, and you take that from them.

What is built today: Status

The label at a glance

The numbers in the drawing match the list. Sample data is made up.

Schematic of a shipping label with six numbered elements A portrait label. From the top: 1 the sender, 2 the recipient name and address, 3 a routing code in large text beside 4 an optional 2D symbol, 5 a linear barcode with its number in readable text, and 6 an order reference with a parcel count. The bars and the 2D symbol are decorative, not scannable. FROM 1 SHIP TO Example Logistics Inc. 123 Example Street Panama City 2 ROUTING 123456 3 2D 4 48213 0003 5 REFERENCE PO-48213 1 of 3 6
Schematic, not scannable. The elements most shipping labels have, in a common order, with made-up sample data. It is not any carrier's layout and not a label to copy: yours follows the specification of whoever receives or carries the parcel.
  1. SenderWho sent the parcel and where it goes back to. Small text, usually at the top.
  2. RecipientName, street, city, postal code and country as text. The largest text on the label, so it reads at a glance.
  3. Routing textA postal or sorting code, repeated in large type so it is easy to find.
  4. 2D symbol (optional)More data in a small area, when the receiver asks for it.
  5. Linear barcodeA tracking or reference number as bars, with the same number in readable text under it.
  6. References and countAn order or purchase-order reference, and a count such as "1 of 3" for an order that ships in several parcels.

Which barcodes, and why

A shipping label has to be read by people and by scanners. People read the address. Scanners read the barcodes, so the barcodes carry whatever the receiving system looks up: a tracking number, a reference, sometimes more.

Barcodes a shipping label typically carries and the edition each needs
BarcodeWhy it is on the labelEdition
Code 128A linear barcode for a tracking number or a reference. Code 128 holds letters and digits in one line of bars (see the ^BC page), and the site's symbology table pairs it with data that has no GS1 structure.Basic
Data Matrix, QR Code or PDF417A 2D symbol holds more data in a small area and carries error correction. PDF417 is several linear rows stacked up. Add one when the receiver asks for it.Ultimate
SSCC-18 in GS1-128When the parcel is a logistic unit that your partner identifies with an SSCC. The glossary says an SSCC identifies one logistic unit, such as a pallet or a carton. GS 2.2.1 See pallet labels.Basic

Which symbology is required is the receiver's choice, not a BarcoderX setting. Take it from their label specification, then name it in the template. Whatever you choose, the barcode needs blank margins and bars wide enough to scan: BarcoderX enforces quiet zones, snaps the module width to whole dots and reports the effective size. Symbol options

The data it needs

Everything on the label is a value bound into a template. The sample values below are made up.

Fields a shipping label needs, a sample value and where each goes
FieldSample valueWhere it goes
Sender name and addressCentral warehouse, 100 Dock Road, SpringfieldText, element 1
Recipient name and addressExample Logistics Inc., 123 Example Street, Panama CityText, element 2. Accented letters need the right font and character set.
Routing or postal code123456Large text, element 3. It can also go into a barcode if the receiver asks.
Tracking or reference number48213 0003The linear barcode, element 5, and the same digits as readable text under it.
Order referencePO-48213Text, element 6.
Parcel number and count1 of 3Text, element 6.

The values come from your own data: objects, a DataTable, CSV, JSON or XML. Counters, masks and more than 100 built-in functions produce the values that change on every label. If a number carries a check digit, BarcoderX computes it, validates it or leaves it out, as you choose. Templates and data Fonts and accents Check digit calculator

How it reaches the printer

The printer commands are the same on both routes, and both run on infrastructure you operate.

  • Direct, from your application. The SDK packages send the printer commands from your own .NET process over TCP port 9100, serial, the Windows spooler, CUPS or USB. No API server and no agent is in the path.
  • Through your API server. Your application queues a print job through the REST API on your API server. A print agent on the printer's network collects it and writes it to the printer beside it. The agent only dials out, so the printer network needs no inbound port.

Shipping labels are usually printed by a program. An order is packed or a parcel gets its tracking number, and a service builds the label and sends it to a printer: no one is signed in, no browser is open and no print dialog appears. That is server-side printing, and the guide linked below compares the architectures.

Delivery to the agent is at-least-once and the agent de-duplicates by job id, so a reconnect does not print a label twice. Print jobs also honor an idempotency key, so a retried request does not queue a second label. When a job has many labels, static content is stored on the printer once and recalled for each label.

The browser never calls a port on your machine. If the print button is in a web app, the job goes to the server and the agent delivers it. Print thermal labels from a web app

A job queued on your API server moves through states you can see:

  1. Queued
  2. Dispatched
  3. Received
  4. Spooled
  5. Printed
  • Failed
  • Canceled
  • Expired

Which edition covers it

EditionsBasic covers the linear (1D) and postal symbologies, including every GS1 DataBar variant; Ultimate adds the PDF417 family, other multi-row symbologies, every matrix (2D) symbology and GS1 composites, as set out on the pricing page.

For a shipping label, that means a Code 128 tracking barcode is in Basic. A Data Matrix, QR Code or PDF417 symbol needs Ultimate.

The ZPL behind it

If you read the printer commands, these are the ones a shipping label uses. Each page explains one command in our own words from the programming guide.

^FO
Places a field at a position counted in dots.
^FB
Turns text into a block that wraps, for an address.
^BC
Prints a Code 128 barcode.
^BY
Sets the module width of the barcodes that follow.
^BX
Prints a Data Matrix barcode.
^B7
Prints a PDF417 barcode.

New to the printer language? Read the ZPL guides and command reference.

Sources What this page says about BarcoderX comes from its published barcodes, printing, platform, FAQ and server-side printing pages. The SSCC statement is GS1 General Specifications section 2.2.1, as quoted in the glossary. The description of a shipping label is general and ours: it is not a carrier or GS1 specification, and no carrier is named on purpose.

Written by BarcoderX in its own words.

ZPL and ZPL II are trademarks of Zebra Technologies Corporation. BarcoderX is an independent product and is not affiliated with, endorsed by or sponsored by Zebra Technologies.