Skip to main content
POST
Generate multiple codes in one request. For a single definition without a list wrapper, use Generate 2D barcode.

Optional parameters

ais, linkType, context and extensionParameters may be omitted. Omitting linkType or context (or sending null) adds no corresponding query parameter. Omitting ais or extensionParameters (or sending null) is equivalent to an empty list ([]).

Compression

Each item may independently set compression to EPC_BASE64 or EPC_HEX. Omit it or send null for an uncompressed URI. Compressed and uncompressed codes can share a batch. The same prerequisites as single generation apply: digitalLinkStem, primary key 01, serial number AI 21, and none of the AIs 03, 717, 8014 or 8040–8043.
The resulting barcodeText uses an ex or eh path; hri keeps the original GS1 data. Invalid compression is reported for the affected item in errors, with code Validation.Invalid.compression and path compression. The batch status remains 200 OK.

GS1 Application Identifiers

Browse the official GS1 Application Identifiers directory to choose identifiers for primaryKey and ais. It describes their meaning, value format, mandatory associations, invalid pairings and permitted use in GS1 Digital Link URIs. The API validates against its bundled GS1 Barcode Syntax Dictionary. Not every identifier in the directory can be used as a primary key or combined with every other AI.

Partial success

Every item of a batch is validated on its own, so a rejected item does not fail the request. The status stays 200 OK even when every item was rejected and codes comes back empty, which means you should check errors rather than the status code. Each request item may include a string reference of your choice. The API echoes it unchanged in either codes or errors. If omitted or null, the reference is the item’s zero-based position in the original request, returned as a string: "0", "1", and so on. Empty strings are preserved. Use distinct references and avoid collisions with generated references within a batch. References do not provide deduplication or idempotency.

Validation codes

path matches the part of the definition at fault, so ais.2 is the third entry of ais.

Authorizations

Authorization
string
header
required

The access_token from POST /oauth/token.

Body

codes
object[]
required

The definitions to generate. Items are processed in order and each one is validated on its own.

Response

Generated codes in codes, rejected definitions in errors. Both carry reference, which ties an entry back to the item you sent.

codes
object[]
required
errors
object[]
required