Overview
Shipping Label Formats
This guide describes the shipping label formats supported by the API, the available response types (binary file or Base64-encoded JSON), and the correct handling of each option based on your integration and printing requirements.
When requesting a label, you can specify the response type as either:
- a binary file (raw label), or
- a JSON object containing a Base64-encoded label and metadata.
Some label formats are available across all services, while others are service-specific.
How labels are returned by the API
Depending on the requested Accept header, the API returns labels in one of the following ways.
Raw response (PDF binary or plain text)
The response body contains the label directly:
- PDF → binary file
- ZPL / EPL / DPL → plain text printer commands
Use this option if:
- you want to immediately save or stream the file,
- you are sending printer commands directly to a thermal printer.
Examples:
application/pdf;format=A4→ binaryapplication/pdf;format=A6→ binarytext/zpl;dpi=203→ plain texttext/zpl;dpi=300→ plain texttext/epl2;dpi=203→ plain texttext/dpl;dpi=203→ plain text
The response body is the label itself:
- binary data for PDF
- plain text for ZPL / EPL / DPL
JSON response with Base64-encoded label
The response body is a JSON object. The label content is provided as a Base64-encoded string.
After decoding:
- PDF → binary file
- ZPL / EPL / DPL → plain text printer commands
Use this option if:
- the label needs to be processed, transformed, or stored programmatically,
- the integration does not use a direct print flow.
Examples:
application/pdf+json;format=A4application/pdf+json;format=A6text/zpl+json;dpi=203text/zpl+json;dpi=300text/epl2+json;dpi=203text/dpl+json;dpi=203
How to decode a Base64 label
After decoding:
- PDF results in a binary file (
.pdf) - ZPL / EPL / DPL results in a plain text that can be sent directly to a thermal printer.
import fs from "fs";
const base64Label = response.label;
const buffer = Buffer.from(base64Label, "base64");
fs.writeFileSync("label.pdf", buffer);
Available label formats:
1. PDF Recommended for office printers and manual printing workflows.
| Format | Response type |
|---|---|
application/pdf;format=A4 | Binary |
application/pdf;format=A6 | Binary |
application/pdf+json;format=A4 | JSON + Base64 |
application/pdf+json;format=A6 | JSON + Base64 |
A4 format note: Labels in
format=A4are rendered as quarter-page layouts.
Available for all services.
2. ZPL (Zebra Programming Language) Optimal for automated label printing on Zebra thermal printers.
| Format | Response type |
|---|---|
text/zpl;dpi=203 | Plain text |
text/zpl;dpi=300 | Plain text |
text/zpl+json;dpi=203 | JSON + Base64 |
text/zpl+json;dpi=300 | JSON + Base64 |
Available for all services.
3. EPL (Eltron Programming Language) Optimal for automated label printing on compatible thermal printers.
| Format | Response type |
|---|---|
text/epl2;dpi=203 | Plain text |
text/epl2+json;dpi=203 | JSON + Base64 |
Available exclusively for domestic services within Poland.
4. DPL (Datamax Programming Language)
Optimal for automated label printing on compatible thermal printers.
| Format | Response type | Availability |
|---|---|---|
text/dpl;dpi=203 | Plain text | Poland domestic (pilot) |
text/dpl+json;dpi=203 | JSON + Base64 | Poland domestic (pilot) |
Pilot phase: Currently available for selected domestic services in Poland. If you are interested in using this format, please contact the Integrations team.