Skip to main content
POST
Render one code as a Base64-encoded SVG in a JSON response. The same GS1 validation used by POST /code applies. This operation requires write:codes and does not save a generated-code record or a file.

Barcode modes

For QR modes, optional errorCorrectionLevel accepts L, M, Q or H. Omitting it or sending null selects L. The requested level is used without automatic upgrading. Data Matrix uses fixed ECC 200: omit errorCorrectionLevel or send null; any other value is rejected. ais and extensionParameters may be omitted or null for empty lists. linkType and context are optional. The image field contains the SVG encoded as Base64.

Compression

The optional compression field accepts EPC_BASE64 (ex) or EPC_HEX (eh). Omit it or send null to render an uncompressed URI. Compression is available in QR_GS1_DIGITAL_LINK_URI and DATAMATRIX_GS1_DIGITAL_LINK_URI modes. It requires a GTIN, a serial number and digitalLinkStem, with the same AI restrictions as generation.
The SVG encodes the compressed URI. The response still contains image, a Base64-encoded SVG; this image encoding is separate from the EPC encoding selected by compression. Invalid compression returns 422 with Validation.Invalid.compression at path compression. The GS1_QR and GS1_DATAMATRIX modes do not accept compression.

Download an SVG

Success returns 200 OK with a JSON object containing image. Example response body:
The SVG is black on white, with quiet zones of four modules for QR and one for Data Matrix. It contains no printed human-readable label. Invalid code definitions or rendering parameters return 422 with an errors array.

Authorizations

Authorization
string
header
required

The access_token from POST /oauth/token.

Body

mode
enum<string>
required

Barcode type. Digital Link modes require digitalLinkStem.

Available options:
GS1_DATAMATRIX,
DATAMATRIX_GS1_DIGITAL_LINK_URI,
GS1_QR,
QR_GS1_DIGITAL_LINK_URI
Example:

"QR_GS1_DIGITAL_LINK_URI"

primaryKey
object
required

The identifying application identifier. With a digitalLinkStem it must be a GS1 Digital Link primary key in the GS1 Barcode Syntax Dictionary; without one, 03 is additionally accepted, the identifier for made-to-order trade items.

GTIN (01) accepts 8, 12, 13 or 14 digits, verifies the mod-10 check digit and normalises the value to 14 digits, so the value you get back may be longer than the one you sent.

errorCorrectionLevel
enum<string> | null

QR only: L, M, Q or H. Omitted or null selects L for QR. For Data Matrix omit or send null.

Available options:
L,
M,
Q,
H,
null
ais
object[] | null

Further application identifiers. Pass [] for none.

Each key must exist in the GS1 Barcode Syntax Dictionary and its value must match the format that dictionary declares. An AI may not repeat the primary key, keys may not repeat each other, and GS1 "requires" and "excludes" relations between AIs are enforced.

With a digitalLinkStem every AI must be either a path qualifier of the chosen primary key, taken from a single consistent qualifier sequence, or a data attribute that GS1 Digital Link URI Syntax allows in the query string. Qualifiers keep the order GS1 defines, not the order you send.

Temperature AIs (4330 to 4333) are normalised for you: the magnitude is padded to six digits and a negative value keeps its trailing minus.

When compression is selected, the EPC path carries these AIs instead of separate path and query fields.

extensionParameters
object[] | null

Optional custom query parameters appended to a GS1 Digital Link URI. Omit, send null or pass [] for none.

Only with a digitalLinkStem; a non-empty list without one is rejected. Keys must not be linkType or context, must contain at least one non-digit, must be unique, and both keys and values are limited to unreserved ASCII and URI punctuation.

The origin a GS1 Digital Link path is appended to. Supplying it is what makes this a GS1 Digital Link: send a stem and you get a URI, leave it out and you get a GS1 element string. Must be http or https with a host, and carry no userinfo, query or fragment. A single trailing slash is stripped; empty path segments are rejected.

Example:

"https://gtin.at"

The GS1 link type the URI resolves to. Only with a digitalLinkStem. A gs1: value must be one the generator offers from the GS1 Web Vocabulary page types; gs1:defaultPage, gs1:defaultPageMulti and gs1:handledBy are not selectable. Any other value must be an absolute http or https URI.

Example:

"gs1:pip"

context
string | null

Value for the GS1 Digital Link context query parameter. Only with a digitalLinkStem, same character rules as extension parameter values.

Example:

"dpp"

compression
enum<string> | null

Optional EPC compression of a GS1 Digital Link URI. EPC_BASE64 encodes the EPC binary in URL-safe Base64 (an ex path); EPC_HEX uses hexadecimal (an eh path). Omit or send null for an uncompressed URI.

Requires primary key 01 (GTIN), AI 21 (serial number), and digitalLinkStem. AIs 03, 717, 8014 and 8040–8043 cannot be stored in EPC binary, so a code that contains any of them cannot be compressed. The EPC path carries the AIs; extensionParameters, linkType, and context remain query parameters. Human-readable interpretation (hri) is unchanged.

An unknown or inapplicable value produces Validation.Invalid.compression: HTTP 422 for a single code, or a per-item error in the batch HTTP 200 response.

Only available for QR_GS1_DIGITAL_LINK_URI and DATAMATRIX_GS1_DIGITAL_LINK_URI; not for GS1 element-string modes.

Available options:
EPC_BASE64,
EPC_HEX,
null
Examples:

"EPC_BASE64"

"EPC_HEX"

Response

Base64-encoded SVG in the image field.

image
file
required

Base64-encoded SVG document (UTF-8).