Skip to content

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 → binary
  • application/pdf;format=A6 → binary
  • text/zpl;dpi=203 → plain text
  • text/zpl;dpi=300 → plain text
  • text/epl2;dpi=203 → plain text
  • text/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=A4
  • application/pdf+json;format=A6
  • text/zpl+json;dpi=203
  • text/zpl+json;dpi=300
  • text/epl2+json;dpi=203
  • text/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.

FormatResponse type
application/pdf;format=A4Binary
application/pdf;format=A6Binary
application/pdf+json;format=A4JSON + Base64
application/pdf+json;format=A6JSON + Base64

A4 format note: Labels in format=A4 are rendered as quarter-page layouts.

Available for all services.

2. ZPL (Zebra Programming Language) Optimal for automated label printing on Zebra thermal printers.

FormatResponse type
text/zpl;dpi=203Plain text
text/zpl;dpi=300Plain text
text/zpl+json;dpi=203JSON + Base64
text/zpl+json;dpi=300JSON + Base64

Available for all services.

3. EPL (Eltron Programming Language) Optimal for automated label printing on compatible thermal printers.

FormatResponse type
text/epl2;dpi=203Plain text
text/epl2+json;dpi=203JSON + Base64

Available exclusively for domestic services within Poland.

4. DPL (Datamax Programming Language)

Optimal for automated label printing on compatible thermal printers.

FormatResponse typeAvailability
text/dpl;dpi=203Plain textPoland domestic (pilot)
text/dpl+json;dpi=203JSON + Base64Poland 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.


API Documentation

Loading...