Generate the payload and human-readable interpretation for one 2D barcode.
Set compression on each definition to EPC_BASE64 or EPC_HEX for a compressed Digital Link. Omit or send null for an uncompressed URI. Compression requires a GTIN and serial number.
Supply digitalLinkStem for a GS1 Digital Link URI, or omit it for a GS1 element string.
ais and extensionParameters are optional and treated as empty lists when omitted or null.
linkType and context are optional.Choose identifiers from the GS1 Application Identifiers directory.
For linkType values, see the GS1 Web Vocabulary.The endpoint requires write:codes. Invalid definitions return 422 with JSON validation details.
For multiple definitions in one request, use
Batch Generate 2D barcodes.
To download an SVG, use Render 2D barcode.
Set compression to encode a serialised GTIN in an EPC path:
Value
URI path
EPC_BASE64
ex followed by EPC binary encoded in URL-safe Base64.
EPC_HEX
eh followed by EPC binary encoded in hexadecimal.
Omitted or null
Uncompressed GS1 Digital Link URI.
Compression requires digitalLinkStem, primary key 01 (GTIN), and AI 21 (serial number).
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.
The hri value stays unchanged.Example request:
An unknown compression value, a missing serial number, a primary key other than 01, or one of the AIs
listed above returns 422 with Validation.Invalid.compression at path compression.
Compression cannot be used for a GS1 element string.
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.
GS1 application identifier. Browse the official GS1 Application Identifiers directory for meanings, value formats, required associations and Digital Link usage. The API validates identifiers against its bundled GS1 Barcode Syntax Dictionary; not every AI is valid as a primary key or in every combination.
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.
GS1 application identifier. Browse the official GS1 Application Identifiers directory for meanings, value formats, required associations and Digital Link usage. The API validates identifiers against its bundled GS1 Barcode Syntax Dictionary; not every AI is valid as a primary key or in every combination.
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.
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.
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.
Human-readable interpretation of the GS1 data. Compression does not change this value.
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Thing Identity","colors":{"primary":"#18181B","light":"#FAFAFA","dark":"#18181B"},"logo":{"light":"https://mintcdn.com/thing-identity/kRu3PmIiw7bjxaKS/logo/light.svg?fit=max\u0026auto=format\u0026n=kRu3PmIiw7bjxaKS\u0026q=85\u0026s=5b0ca7ae1844542e1d6472bfd08fcb66","dark":"https://mintcdn.com/thing-identity/kRu3PmIiw7bjxaKS/logo/dark.svg?fit=max\u0026auto=format\u0026n=kRu3PmIiw7bjxaKS\u0026q=85\u0026s=12ef220c8158b022a6a3ee4cfb188ecf","href":"https://thingidentity.com"},"favicon":"https://mintcdn.com/thing-identity/kRu3PmIiw7bjxaKS/favicon.svg?fit=max\u0026auto=format\u0026n=kRu3PmIiw7bjxaKS\u0026q=85\u0026s=90d75e0448360010512d1be2344f0683","api":{"params":{"expanded":"all"},"examples":{"languages":["curl","javascript","python"]}},"appearance":{"default":"system"},"navbar":{"primary":{"type":"button","label":"Dashboard","href":"https://thingidentity.com/dashboard"}},"footer":{"socials":{"github":"https://github.com/thingidentity","linkedin":"https://linkedin.com/company/thingidentity"}},"styling":{"eyebrows":"breadcrumbs","latex":false},"navigation":{"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://thingidentity.com/blog"}]},"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"thing-identity","hasAudioNarration":false,"actualSubdomain":"thing-identity","customDomains":["docs.thingidentity.com"],"gitSource":{"type":"github","owner":"thingidentity","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"latestBuiltDeploymentHistoryId":"6aba87ec9d1721df0ac6e555","collectionId":"81b7d3d8-ea66-42f1-9692-54ff1ad3ad4b","liveDeploymentHistoryId":"6aba87ec9d1721df0ac6e555","schemaVersion":"v3"},"entitlements":{"AI_CHAT":{"status":"DISABLED"},"WEB_MCP":{"status":"DISABLED"}},"buildId":"6aba87ec9d1721df0ac6e555","clientVersion":"0.0.3990","searchFilterCounts":[{"language":"default","tag":"API Reference","count":12},{"language":"default","tag":"2D Barcodes","count":4},{"language":"default","tag":"GS1 Resolver","count":3},{"language":"default","tag":"API Documentation","count":2},{"language":"default","tag":"Authentication","count":1},{"language":"default","tag":"Guides","count":1},{"language":"default","tag":"Get Started","count":1}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-v7-file-tree","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"pause-universal-search-reconcile","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"per-site-search-delta","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-private-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-nav-generations","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"byok-sep-25","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-agent-model-picker","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-updated-9-15","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"privacy":{"consentBanner":{"enabled":true}},"isAtlas":false,"googleFontsInlined":false},"customCss":[{"filePath":"style.css","content":":root{--ti-radius:0.375rem}@media (min-width:1024px){#navbar div:has(>#search-bar-entry){position:absolute;left:50%;width:min(34rem,40vw);transform:translateX(-50%)}}#search-bar-entry,#topbar-cta-button>a{border-radius:var(--ti-radius)}#navbar .nav-logo{height:1.25rem}"}],"page":{"pagePath":"api-reference/endpoints/generate-code","slug":"/api-reference/endpoints/generate-code","pageMetadata":{"title":"Generate 2D barcode","openapi":"openapi.json POST /code","description":"Generate the payload and human-readable interpretation for one 2D barcode.\n\nSet `compression` on each definition to `EPC_BASE64` or `EPC_HEX` for a compressed Digital Link. Omit or send null for an uncompressed URI. Compression requires a GTIN and serial number.","href":"/api-reference/endpoints/generate-code"},"description":{"compiledSource":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n code: \"code\",\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsxs(_Fragment, {\n children: [_jsx(_components.p, {\n children: \"Generate the payload and human-readable interpretation for one 2D barcode.\"\n }), \"\\n\", _jsxs(_components.p, {\n children: [\"Set \", _jsx(_components.code, {\n children: \"compression\"\n }), \" on each definition to \", _jsx(_components.code, {\n children: \"EPC_BASE64\"\n }), \" or \", _jsx(_components.code, {\n children: \"EPC_HEX\"\n }), \" for a compressed Digital Link. Omit or send null for an uncompressed URI. Compression requires a GTIN and serial number.\"]\n })]\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{CodeBlock,Heading,Table}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(Heading,{level:`2`,id:`example`,children:`Example`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`5`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`5`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"digitalLinkStem\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://gtin.at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"primaryKey\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"01\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"value\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"09521234543213\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"ais\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [{ `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"10\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"value\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"LOT42\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }]`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"barcodeText\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://gtin.at/01/09521234543213/10/LOT42\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"hri\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"(01)09521234543213(10)LOT42\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Supply `,_jsx(_components.code,{children:`digitalLinkStem`}),` for a GS1 Digital Link URI, or omit it for a GS1 element string.\n`,_jsx(_components.code,{children:`ais`}),` and `,_jsx(_components.code,{children:`extensionParameters`}),` are optional and treated as empty lists when omitted or null.\n`,_jsx(_components.code,{children:`linkType`}),` and `,_jsx(_components.code,{children:`context`}),` are optional.`]}),`\n`,_jsxs(_components.p,{children:[`Choose identifiers from the `,_jsx(_components.a,{href:`https://ref.gs1.org/ai/`,children:`GS1 Application Identifiers directory`}),`.\nFor `,_jsx(_components.code,{children:`linkType`}),` values, see the `,_jsx(_components.a,{href:`https://ref.gs1.org/voc/`,children:`GS1 Web Vocabulary`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`The endpoint requires `,_jsx(_components.code,{children:`write:codes`}),`. Invalid definitions return `,_jsx(_components.code,{children:`422`}),` with JSON validation details.\nFor multiple definitions in one request, use\n`,_jsx(_components.a,{href:`/api-reference/endpoints/generate-codes`,children:`Batch Generate 2D barcodes`}),`.\nTo download an SVG, use `,_jsx(_components.a,{href:`/api-reference/endpoints/render-code`,children:`Render 2D barcode`}),`.`]}),`\n`,_jsx(Heading,{level:`2`,id:`compression`,children:`Compression`}),`\n`,_jsxs(_components.p,{children:[`Set `,_jsx(_components.code,{children:`compression`}),` to encode a serialised GTIN in an EPC path:`]}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Value`}),_jsx(_components.th,{children:`URI path`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`EPC_BASE64`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`ex`}),` followed by EPC binary encoded in URL-safe Base64.`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`EPC_HEX`})}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`eh`}),` followed by EPC binary encoded in hexadecimal.`]})]}),_jsxs(_components.tr,{children:[_jsxs(_components.td,{children:[`Omitted or `,_jsx(_components.code,{children:`null`})]}),_jsx(_components.td,{children:`Uncompressed GS1 Digital Link URI.`})]})]})]}),`\n`,_jsxs(_components.p,{children:[`Compression requires `,_jsx(_components.code,{children:`digitalLinkStem`}),`, primary key `,_jsx(_components.code,{children:`01`}),` (GTIN), and AI `,_jsx(_components.code,{children:`21`}),` (serial number).\nAIs `,_jsx(_components.code,{children:`03`}),`, `,_jsx(_components.code,{children:`717`}),`, `,_jsx(_components.code,{children:`8014`}),` and `,_jsx(_components.code,{children:`8040`}),`–`,_jsx(_components.code,{children:`8043`}),` cannot be stored in EPC binary, so a code that contains any of them cannot be compressed.\nThe EPC path carries the AIs; `,_jsx(_components.code,{children:`extensionParameters`}),`, `,_jsx(_components.code,{children:`linkType`}),`, and `,_jsx(_components.code,{children:`context`}),` remain query parameters.\nThe `,_jsx(_components.code,{children:`hri`}),` value stays unchanged.`]}),`\n`,_jsx(_components.p,{children:`Example request:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`6`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`6`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"digitalLinkStem\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://thingidentity.com\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"primaryKey\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"01\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"value\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"09528765123457\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` },`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"ais\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [{ `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"21\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"value\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"123456789123\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"compression\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"EPC_BASE64\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`Example response:`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`4`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`4`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"barcodeText\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://thingidentity.com/ex9xCVKHZRI0VwwcvpkagwAA\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"hri\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"(01)09528765123457(21)123456789123\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`An unknown compression value, a missing serial number, a primary key other than `,_jsx(_components.code,{children:`01`}),`, or one of the AIs\nlisted above returns `,_jsx(_components.code,{children:`422`}),` with `,_jsx(_components.code,{children:`Validation.Invalid.compression`}),` at path `,_jsx(_components.code,{children:`compression`}),`.\nCompression cannot be used for a GS1 element string.`]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Generate 2D barcode","openapi":"openapi.json POST /code","description":"Generate the payload and human-readable interpretation for one 2D barcode.\n\nSet `compression` on each definition to `EPC_BASE64` or `EPC_HEX` for a compressed Digital Link. Omit or send null for an uncompressed URI. Compression requires a GTIN and serial number.","href":"/api-reference/endpoints/generate-code"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Example","slug":"example","depth":2,"children":[]},{"title":"Compression","slug":"compression","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Codes"],"summary":"Generate 2D barcode","operationId":"generateSingleCode","description":"Generate the payload and human-readable interpretation for one 2D barcode.\n\nSet `compression` on each definition to `EPC_BASE64` or `EPC_HEX` for a compressed Digital Link. Omit or send null for an uncompressed URI. Compression requires a GTIN and serial number.","requestBody":"1d1b65fc-5559-4a27-badc-4453643a01f9","responses":{"200":"1d32b72a-64e8-415e-a8ab-49fa9a1b7498","400":"be7dd155-9be0-4985-a62b-260a39531f88","401":"ffb5818e-194e-423c-b0ee-d389de0ce658","403":"c77e7495-4fbe-4634-ba0f-555455c41edc","422":"7b0a51f5-047b-448a-8725-fc4353868452"},"method":"post","type":"path","servers":["751c3ee5-c165-428a-a409-06e1fbd3b211"],"security":["5e1efa94-7214-484a-9905-e1c0370b3c91"],"path":"/code","baseUrlOptions":["https://api.thingidentity.com"],"title":"Generate 2D barcode","codeSamples":[],"requestExampleLanguages":["bash","javascript","python"],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{},"requestBody":{"required":true,"content":{"application/vnd.thingidentity.public.v1+json":{"schema":{"type":"object","required":["primaryKey"],"example":{"digitalLinkStem":"https://gtin.at","primaryKey":{"key":"01","value":"09521234543213"},"ais":[{"key":"10","value":"LOT42"}]},"properties":{"primaryKey":{"type":"object","description":"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.\n\nGTIN (`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.","required":["key","value"],"properties":{"key":{"type":"string","description":"GS1 application identifier. Browse the official [GS1 Application Identifiers directory](https://ref.gs1.org/ai/) for meanings, value formats, required associations and Digital Link usage. The API validates identifiers against its bundled GS1 Barcode Syntax Dictionary; not every AI is valid as a primary key or in every combination.","examples":["01"],"isRequired":true,"uniqueKey":"primaryKey.key","typeLabel":"string"},"value":{"type":"string","examples":["09521234543213"],"isRequired":true,"uniqueKey":"primaryKey.value","typeLabel":"string"}},"isRequired":true,"uniqueKey":"primaryKey","typeLabel":"object"},"ais":{"oneOf":[{"type":"array","description":"Further application identifiers. Pass `[]` for none.\n\nEach 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.\n\nWith 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.\n\nTemperature AIs (`4330` to `4333`) are normalised for you: the magnitude is padded to six digits and a negative value keeps its trailing minus.\n\nWhen compression is selected, the EPC path carries these AIs instead of separate path and query fields.","items":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string","description":"GS1 application identifier. Browse the official [GS1 Application Identifiers directory](https://ref.gs1.org/ai/) for meanings, value formats, required associations and Digital Link usage. The API validates identifiers against its bundled GS1 Barcode Syntax Dictionary; not every AI is valid as a primary key or in every combination.","examples":["01"],"isRequired":true,"uniqueKey":"ais.oneOf.0.items.[INDEX].key","typeLabel":"string"},"value":{"type":"string","examples":["09521234543213"],"isRequired":true,"uniqueKey":"ais.oneOf.0.items.[INDEX].value","typeLabel":"string"}},"uniqueKey":"ais.oneOf.0.items.[INDEX]","typeLabel":"object"},"uniqueKey":"ais.oneOf.0","typeLabel":"object[]"},{"type":"null","description":"Further application identifiers. Pass `[]` for none.\n\nEach 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.\n\nWith 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.\n\nTemperature AIs (`4330` to `4333`) are normalised for you: the magnitude is padded to six digits and a negative value keeps its trailing minus.\n\nWhen compression is selected, the EPC path carries these AIs instead of separate path and query fields.","items":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string","description":"GS1 application identifier. Browse the official [GS1 Application Identifiers directory](https://ref.gs1.org/ai/) for meanings, value formats, required associations and Digital Link usage. The API validates identifiers against its bundled GS1 Barcode Syntax Dictionary; not every AI is valid as a primary key or in every combination.","examples":["01"]},"value":{"type":"string","examples":["09521234543213"]}}},"uniqueKey":"ais.oneOf.1","typeLabel":"null"}],"uniqueKey":"ais","typeLabel":"object[] | null"},"extensionParameters":{"oneOf":[{"type":"array","description":"Optional custom query parameters appended to a GS1 Digital Link URI. Omit, send null or pass `[]` for none.\n\nOnly 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.","items":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string","description":"Query parameter name. Not `linkType` or `context`, and it must contain at least one non-digit.","examples":["batch"],"isRequired":true,"uniqueKey":"extensionParameters.oneOf.0.items.[INDEX].key","typeLabel":"string"},"value":{"type":"string","examples":["A42"],"isRequired":true,"uniqueKey":"extensionParameters.oneOf.0.items.[INDEX].value","typeLabel":"string"}},"uniqueKey":"extensionParameters.oneOf.0.items.[INDEX]","typeLabel":"object"},"uniqueKey":"extensionParameters.oneOf.0","typeLabel":"object[]"},{"type":"null","description":"Optional custom query parameters appended to a GS1 Digital Link URI. Omit, send null or pass `[]` for none.\n\nOnly 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.","items":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string","description":"Query parameter name. Not `linkType` or `context`, and it must contain at least one non-digit.","examples":["batch"]},"value":{"type":"string","examples":["A42"]}}},"uniqueKey":"extensionParameters.oneOf.1","typeLabel":"null"}],"uniqueKey":"extensionParameters","typeLabel":"object[] | null"},"digitalLinkStem":{"oneOf":[{"type":"string","description":"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.","examples":["https://gtin.at"],"uniqueKey":"digitalLinkStem.oneOf.0","typeLabel":"string"},{"type":"null","description":"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.","examples":["https://gtin.at"],"uniqueKey":"digitalLinkStem.oneOf.1","typeLabel":"null"}],"uniqueKey":"digitalLinkStem","typeLabel":"string | null"},"linkType":{"oneOf":[{"type":"string","description":"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](https://ref.gs1.org/voc/) page types; `gs1:defaultPage`, `gs1:defaultPageMulti` and `gs1:handledBy` are not selectable. Any other value must be an absolute `http` or `https` URI.","examples":["gs1:pip"],"uniqueKey":"linkType.oneOf.0","typeLabel":"string"},{"type":"null","description":"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](https://ref.gs1.org/voc/) page types; `gs1:defaultPage`, `gs1:defaultPageMulti` and `gs1:handledBy` are not selectable. Any other value must be an absolute `http` or `https` URI.","examples":["gs1:pip"],"uniqueKey":"linkType.oneOf.1","typeLabel":"null"}],"uniqueKey":"linkType","typeLabel":"string | null"},"context":{"oneOf":[{"type":"string","description":"Value for the GS1 Digital Link `context` query parameter. Only with a `digitalLinkStem`, same character rules as extension parameter values.","examples":["dpp"],"uniqueKey":"context.oneOf.0","typeLabel":"string"},{"type":"null","description":"Value for the GS1 Digital Link `context` query parameter. Only with a `digitalLinkStem`, same character rules as extension parameter values.","examples":["dpp"],"uniqueKey":"context.oneOf.1","typeLabel":"null"}],"uniqueKey":"context","typeLabel":"string | null"},"compression":{"oneOf":[{"type":"string","enum":["EPC_BASE64","EPC_HEX",null],"description":"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.\n\nRequires 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.\n\nAn 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.","examples":["EPC_BASE64","EPC_HEX"],"uniqueKey":"compression.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","enum":["EPC_BASE64","EPC_HEX",null],"description":"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.\n\nRequires 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.\n\nAn 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.","examples":["EPC_BASE64","EPC_HEX"],"uniqueKey":"compression.oneOf.1","typeLabel":"null"}],"uniqueKey":"compression","typeLabel":"enum\u003cstring> | null"}},"uniqueKey":"","typeLabel":"object"},"examples":{"uncompressed":{"title":"uncompressed","value":{"digitalLinkStem":"https://gtin.at","primaryKey":{"key":"01","value":"09521234543213"},"ais":[{"key":"10","value":"LOT42"}]}},"EPC_BASE64":{"title":"EPC_BASE64","value":{"digitalLinkStem":"https://thingidentity.com","primaryKey":{"key":"01","value":"09528765123457"},"ais":[{"key":"21","value":"123456789123"}],"compression":"EPC_BASE64"}},"EPC_HEX":{"title":"EPC_HEX","value":{"digitalLinkStem":"https://thingidentity.com","primaryKey":{"key":"01","value":"09528765123457"},"ais":[{"key":"21","value":"123456789123"}],"compression":"EPC_HEX"}}},"exampleType":"examples"},"application/json":{"schema":{"type":"object","required":["primaryKey"],"example":{"digitalLinkStem":"https://gtin.at","primaryKey":{"key":"01","value":"09521234543213"},"ais":[{"key":"10","value":"LOT42"}]},"properties":{"primaryKey":{"type":"object","description":"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.\n\nGTIN (`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.","required":["key","value"],"properties":{"key":{"type":"string","description":"GS1 application identifier. Browse the official [GS1 Application Identifiers directory](https://ref.gs1.org/ai/) for meanings, value formats, required associations and Digital Link usage. The API validates identifiers against its bundled GS1 Barcode Syntax Dictionary; not every AI is valid as a primary key or in every combination.","examples":["01"],"isRequired":true,"uniqueKey":"primaryKey.key","typeLabel":"string"},"value":{"type":"string","examples":["09521234543213"],"isRequired":true,"uniqueKey":"primaryKey.value","typeLabel":"string"}},"isRequired":true,"uniqueKey":"primaryKey","typeLabel":"object"},"ais":{"oneOf":[{"type":"array","description":"Further application identifiers. Pass `[]` for none.\n\nEach 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.\n\nWith 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.\n\nTemperature AIs (`4330` to `4333`) are normalised for you: the magnitude is padded to six digits and a negative value keeps its trailing minus.\n\nWhen compression is selected, the EPC path carries these AIs instead of separate path and query fields.","items":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string","description":"GS1 application identifier. Browse the official [GS1 Application Identifiers directory](https://ref.gs1.org/ai/) for meanings, value formats, required associations and Digital Link usage. The API validates identifiers against its bundled GS1 Barcode Syntax Dictionary; not every AI is valid as a primary key or in every combination.","examples":["01"],"isRequired":true,"uniqueKey":"ais.oneOf.0.items.[INDEX].key","typeLabel":"string"},"value":{"type":"string","examples":["09521234543213"],"isRequired":true,"uniqueKey":"ais.oneOf.0.items.[INDEX].value","typeLabel":"string"}},"uniqueKey":"ais.oneOf.0.items.[INDEX]","typeLabel":"object"},"uniqueKey":"ais.oneOf.0","typeLabel":"object[]"},{"type":"null","description":"Further application identifiers. Pass `[]` for none.\n\nEach 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.\n\nWith 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.\n\nTemperature AIs (`4330` to `4333`) are normalised for you: the magnitude is padded to six digits and a negative value keeps its trailing minus.\n\nWhen compression is selected, the EPC path carries these AIs instead of separate path and query fields.","items":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string","description":"GS1 application identifier. Browse the official [GS1 Application Identifiers directory](https://ref.gs1.org/ai/) for meanings, value formats, required associations and Digital Link usage. The API validates identifiers against its bundled GS1 Barcode Syntax Dictionary; not every AI is valid as a primary key or in every combination.","examples":["01"]},"value":{"type":"string","examples":["09521234543213"]}}},"uniqueKey":"ais.oneOf.1","typeLabel":"null"}],"uniqueKey":"ais","typeLabel":"object[] | null"},"extensionParameters":{"oneOf":[{"type":"array","description":"Optional custom query parameters appended to a GS1 Digital Link URI. Omit, send null or pass `[]` for none.\n\nOnly 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.","items":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string","description":"Query parameter name. Not `linkType` or `context`, and it must contain at least one non-digit.","examples":["batch"],"isRequired":true,"uniqueKey":"extensionParameters.oneOf.0.items.[INDEX].key","typeLabel":"string"},"value":{"type":"string","examples":["A42"],"isRequired":true,"uniqueKey":"extensionParameters.oneOf.0.items.[INDEX].value","typeLabel":"string"}},"uniqueKey":"extensionParameters.oneOf.0.items.[INDEX]","typeLabel":"object"},"uniqueKey":"extensionParameters.oneOf.0","typeLabel":"object[]"},{"type":"null","description":"Optional custom query parameters appended to a GS1 Digital Link URI. Omit, send null or pass `[]` for none.\n\nOnly 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.","items":{"type":"object","required":["key","value"],"properties":{"key":{"type":"string","description":"Query parameter name. Not `linkType` or `context`, and it must contain at least one non-digit.","examples":["batch"]},"value":{"type":"string","examples":["A42"]}}},"uniqueKey":"extensionParameters.oneOf.1","typeLabel":"null"}],"uniqueKey":"extensionParameters","typeLabel":"object[] | null"},"digitalLinkStem":{"oneOf":[{"type":"string","description":"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.","examples":["https://gtin.at"],"uniqueKey":"digitalLinkStem.oneOf.0","typeLabel":"string"},{"type":"null","description":"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.","examples":["https://gtin.at"],"uniqueKey":"digitalLinkStem.oneOf.1","typeLabel":"null"}],"uniqueKey":"digitalLinkStem","typeLabel":"string | null"},"linkType":{"oneOf":[{"type":"string","description":"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](https://ref.gs1.org/voc/) page types; `gs1:defaultPage`, `gs1:defaultPageMulti` and `gs1:handledBy` are not selectable. Any other value must be an absolute `http` or `https` URI.","examples":["gs1:pip"],"uniqueKey":"linkType.oneOf.0","typeLabel":"string"},{"type":"null","description":"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](https://ref.gs1.org/voc/) page types; `gs1:defaultPage`, `gs1:defaultPageMulti` and `gs1:handledBy` are not selectable. Any other value must be an absolute `http` or `https` URI.","examples":["gs1:pip"],"uniqueKey":"linkType.oneOf.1","typeLabel":"null"}],"uniqueKey":"linkType","typeLabel":"string | null"},"context":{"oneOf":[{"type":"string","description":"Value for the GS1 Digital Link `context` query parameter. Only with a `digitalLinkStem`, same character rules as extension parameter values.","examples":["dpp"],"uniqueKey":"context.oneOf.0","typeLabel":"string"},{"type":"null","description":"Value for the GS1 Digital Link `context` query parameter. Only with a `digitalLinkStem`, same character rules as extension parameter values.","examples":["dpp"],"uniqueKey":"context.oneOf.1","typeLabel":"null"}],"uniqueKey":"context","typeLabel":"string | null"},"compression":{"oneOf":[{"type":"string","enum":["EPC_BASE64","EPC_HEX",null],"description":"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.\n\nRequires 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.\n\nAn 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.","examples":["EPC_BASE64","EPC_HEX"],"uniqueKey":"compression.oneOf.0","typeLabel":"enum\u003cstring>"},{"type":"null","enum":["EPC_BASE64","EPC_HEX",null],"description":"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.\n\nRequires 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.\n\nAn 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.","examples":["EPC_BASE64","EPC_HEX"],"uniqueKey":"compression.oneOf.1","typeLabel":"null"}],"uniqueKey":"compression","typeLabel":"enum\u003cstring> | null"}},"uniqueKey":"","typeLabel":"object"},"examples":{"uncompressed":{"title":"uncompressed","value":{"digitalLinkStem":"https://gtin.at","primaryKey":{"key":"01","value":"09521234543213"},"ais":[{"key":"10","value":"LOT42"}]}},"EPC_BASE64":{"title":"EPC_BASE64","value":{"digitalLinkStem":"https://thingidentity.com","primaryKey":{"key":"01","value":"09528765123457"},"ais":[{"key":"21","value":"123456789123"}],"compression":"EPC_BASE64"}},"EPC_HEX":{"title":"EPC_HEX","value":{"digitalLinkStem":"https://thingidentity.com","primaryKey":{"key":"01","value":"09528765123457"},"ais":[{"key":"21","value":"123456789123"}],"compression":"EPC_HEX"}}},"exampleType":"examples"}},"exampleType":"examples"},"responses":{"1d32b72a-64e8-415e-a8ab-49fa9a1b7498":{"description":"Generated code.","content":{"application/vnd.thingidentity.public.v1+json":{"schema":{"type":"object","required":["barcodeText","hri"],"properties":{"barcodeText":{"type":"string","description":"Payload to encode in a 2D barcode. With compression, this is the URI with an EPC `ex` or `eh` path.","isRequired":true,"uniqueKey":"barcodeText","typeLabel":"string"},"hri":{"type":"string","description":"Human-readable interpretation of the GS1 data. Compression does not change this value.","isRequired":true,"uniqueKey":"hri","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"example":{"barcodeText":"https://gtin.at/01/09521234543213/10/LOT42","hri":"(01)09521234543213(10)LOT42"},"examples":{"Example":{"title":"Example","value":{"barcodeText":"https://gtin.at/01/09521234543213/10/LOT42","hri":"(01)09521234543213(10)LOT42"}}},"exampleType":"examples"},"application/json":{"schema":{"type":"object","required":["barcodeText","hri"],"properties":{"barcodeText":{"type":"string","description":"Payload to encode in a 2D barcode. With compression, this is the URI with an EPC `ex` or `eh` path.","isRequired":true,"uniqueKey":"barcodeText","typeLabel":"string"},"hri":{"type":"string","description":"Human-readable interpretation of the GS1 data. Compression does not change this value.","isRequired":true,"uniqueKey":"hri","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"example":{"barcodeText":"https://gtin.at/01/09521234543213/10/LOT42","hri":"(01)09521234543213(10)LOT42"},"examples":{"Example":{"title":"Example","value":{"barcodeText":"https://gtin.at/01/09521234543213/10/LOT42","hri":"(01)09521234543213(10)LOT42"}}},"exampleType":"examples"}},"exampleType":"examples"},"be7dd155-9be0-4985-a62b-260a39531f88":{"description":"Malformed request or missing primaryKey.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"ffb5818e-194e-423c-b0ee-d389de0ce658":{"description":"Missing or invalid bearer token.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"c77e7495-4fbe-4634-ba0f-555455c41edc":{"description":"Token lacks write:codes or API access.","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"7b0a51f5-047b-448a-8725-fc4353868452":{"description":"Invalid GS1 definition.","content":{"application/vnd.thingidentity.public.v1+json":{"schema":{"type":"object","required":["errors"],"properties":{"errors":{"type":"array","items":{"type":"object","required":["code"],"properties":{"code":{"type":"string","examples":["Forbidden"],"isRequired":true,"uniqueKey":"errors.items.[INDEX].code","typeLabel":"string"},"path":{"oneOf":[{"type":"string","description":"The offending field when the error is about input, `null` otherwise.","uniqueKey":"errors.items.[INDEX].path.oneOf.0","typeLabel":"string"},{"type":"null","description":"The offending field when the error is about input, `null` otherwise.","uniqueKey":"errors.items.[INDEX].path.oneOf.1","typeLabel":"null"}],"uniqueKey":"errors.items.[INDEX].path","typeLabel":"string | null"},"message":{"type":"string","uniqueKey":"errors.items.[INDEX].message","typeLabel":"string"}},"uniqueKey":"errors.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"errors","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"example":{"errors":[{"code":"Validation.Invalid.primaryKey","path":"primaryKey"}]},"examples":{"Example":{"title":"Example","value":{"errors":[{"code":"Validation.Invalid.primaryKey","path":"primaryKey"}]}}},"exampleType":"examples"},"application/json":{"schema":{"type":"object","required":["errors"],"properties":{"errors":{"type":"array","items":{"type":"object","required":["code"],"properties":{"code":{"type":"string","examples":["Forbidden"],"isRequired":true,"uniqueKey":"errors.items.[INDEX].code","typeLabel":"string"},"path":{"oneOf":[{"type":"string","description":"The offending field when the error is about input, `null` otherwise.","uniqueKey":"errors.items.[INDEX].path.oneOf.0","typeLabel":"string"},{"type":"null","description":"The offending field when the error is about input, `null` otherwise.","uniqueKey":"errors.items.[INDEX].path.oneOf.1","typeLabel":"null"}],"uniqueKey":"errors.items.[INDEX].path","typeLabel":"string | null"},"message":{"type":"string","uniqueKey":"errors.items.[INDEX].message","typeLabel":"string"}},"uniqueKey":"errors.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"errors","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"example":{"errors":[{"code":"Validation.Invalid.primaryKey","path":"primaryKey"}]},"examples":{"Example":{"title":"Example","value":{"errors":[{"code":"Validation.Invalid.primaryKey","path":"primaryKey"}]}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"5e1efa94-7214-484a-9905-e1c0370b3c91":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"The `access_token` from `POST /oauth/token`.","scopes":[]}}},"servers":{"751c3ee5-c165-428a-a409-06e1fbd3b211":{"url":"https://api.thingidentity.com"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"The `access_token` from `POST /oauth/token`.","scopes":[]},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"The `access_token` from `POST /oauth/token`.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"openapi.json"},"subdomain":"thing-identity","siteName":"Thing Identity","title":"Generate 2D barcode - Thing Identity","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-09-28T14:39:05.539Z","originalFileLocation":"api-reference/endpoints/generate-code.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Generate the payload and human-readable interpretation for one 2D barcode. Set compression on each definition to EPC_BASE64 or EPC_HEX for a compressed Digital Link. Omit or send null for an uncompressed URI. Compression requires a GTIN and serial number.\">\u003cmeta data-mint-head name=\"application-name\" content=\"Thing Identity\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/thing-identity/3IW8MTT2ZtvIbmGr/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/thing-identity/3IW8MTT2ZtvIbmGr/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/thing-identity/3IW8MTT2ZtvIbmGr/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/thing-identity/3IW8MTT2ZtvIbmGr/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/thing-identity/3IW8MTT2ZtvIbmGr/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/thing-identity/3IW8MTT2ZtvIbmGr/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/thing-identity/3IW8MTT2ZtvIbmGr/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/thing-identity/3IW8MTT2ZtvIbmGr/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/thing-identity/3IW8MTT2ZtvIbmGr/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Generate 2D barcode - Thing Identity\">\u003cmeta data-mint-head property=\"og:description\" content=\"Generate the payload and human-readable interpretation for one 2D barcode. Set compression on each definition to EPC_BASE64 or EPC_HEX for a compressed Digital Link. Omit or send null for an uncompressed URI. Compression requires a GTIN and serial number.\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Thing Identity\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.thingidentity.com/api-reference/endpoints/generate-code\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://thing-identity.mintlify.app/_mintlify/api/og/v2?division=2D+Barcodes\u0026amp;title=Generate+2D+barcode\u0026amp;description=Generate+the+payload+and+human-readable+interpretation+for+one+2D+barcode.%0A%0ASet+%60compression%60+on+each+definition+to+%60EPC_BASE64%60+or+%60EPC_HEX%60+for+a+compressed+D\u0026amp;theme=cbc6b4ca26d606041ab96dc7\u0026amp;signature=d5e1bea0161282d3d7a87b7c5a324aab701a5d680d669cf84f30ba664a21ba5f\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Generate 2D barcode - Thing Identity\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Generate the payload and human-readable interpretation for one 2D barcode. Set compression on each definition to EPC_BASE64 or EPC_HEX for a compressed Digital Link. Omit or send null for an uncompressed URI. Compression requires a GTIN and serial number.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://thing-identity.mintlify.app/_mintlify/api/og/v2?division=2D+Barcodes\u0026amp;title=Generate+2D+barcode\u0026amp;description=Generate+the+payload+and+human-readable+interpretation+for+one+2D+barcode.%0A%0ASet+%60compression%60+on+each+definition+to+%60EPC_BASE64%60+or+%60EPC_HEX%60+for+a+compressed+D\u0026amp;theme=cbc6b4ca26d606041ab96dc7\u0026amp;signature=d5e1bea0161282d3d7a87b7c5a324aab701a5d680d669cf84f30ba664a21ba5f\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/thing-identity/3IW8MTT2ZtvIbmGr/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Thing Identity\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#18181B\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.thingidentity.com/api-reference/endpoints/generate-code\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/endpoints/generate-code.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.thingidentity.com/#organization\",\"name\":\"Thing Identity\",\"url\":\"https://docs.thingidentity.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/thing-identity/kRu3PmIiw7bjxaKS/logo/light.svg?fit=max\u0026auto=format\u0026n=kRu3PmIiw7bjxaKS\u0026q=85\u0026s=5b0ca7ae1844542e1d6472bfd08fcb66\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.thingidentity.com#website\",\"name\":\"Thing Identity\",\"url\":\"https://docs.thingidentity.com\",\"publisher\":{\"@id\":\"https://docs.thingidentity.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.thingidentity.com/api-reference/endpoints/generate-code#webpage\",\"url\":\"https://docs.thingidentity.com/api-reference/endpoints/generate-code\",\"name\":\"Generate 2D barcode\",\"description\":\"Generate the payload and human-readable interpretation for one 2D barcode. Set compression on each definition to EPC_BASE64 or EPC_HEX for a compressed Digital Link. Omit or send null for an uncompressed URI. Compression requires a GTIN and serial number.\",\"dateModified\":\"2026-09-28T14:39:05.539Z\",\"isPartOf\":{\"@id\":\"https://docs.thingidentity.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.thingidentity.com/api-reference/endpoints/generate-code#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.thingidentity.com/api-reference/endpoints/generate-code#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Thing Identity\",\"item\":\"https://docs.thingidentity.com\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Generate 2D barcode\",\"item\":\"https://docs.thingidentity.com/api-reference/endpoints/generate-code\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.thingidentity.com/api-reference/endpoints/generate-code#apireference\",\"headline\":\"Generate 2D barcode\",\"name\":\"Generate 2D barcode\",\"description\":\"Generate the payload and human-readable interpretation for one 2D barcode. Set compression on each definition to EPC_BASE64 or EPC_HEX for a compressed Digital Link. Omit or send null for an uncompressed URI. Compression requires a GTIN and serial number.\",\"url\":\"https://docs.thingidentity.com/api-reference/endpoints/generate-code\",\"mainEntityOfPage\":{\"@id\":\"https://docs.thingidentity.com/api-reference/endpoints/generate-code#webpage\"},\"dateModified\":\"2026-09-28T14:39:05.539Z\",\"publisher\":{\"@id\":\"https://docs.thingidentity.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.thingidentity.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Thing Identity\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Thing Identity","nav":{"global":{"anchors":[{"anchor":"Blog","icon":"newspaper","href":"https://thingidentity.com/blog"}]},"tabs":[{"tab":"API Reference","groups":[{"group":"Get Started","icon":"rocket","pages":[{"title":"Quickstart","sidebarTitle":"Quickstart","href":"/quickstart"}]},{"group":"Guides","icon":"book","pages":[{"title":"Authentication","sidebarTitle":"Authentication","href":"/guides/authentication"}]},{"group":"API Documentation","icon":"book-open","pages":[{"title":"Introduction","sidebarTitle":"Introduction","href":"/api-reference/introduction"},{"title":"Error handling","sidebarTitle":"Error handling","href":"/api-reference/errors"}]},{"group":"Authentication","icon":"code","pages":[{"title":"Get an access token","openapi":"openapi.json POST /oauth/token","description":"Exchanges the credentials of an API client for a bearer token using the OAuth 2.0 client credentials grant. There is no refresh token: when the access token expires, ask for another one.\n\nCredentials go in an HTTP Basic `Authorization` header, built from `client_id:client_secret`. Create a client in the dashboard under **Organization → API**.","href":"/api-reference/endpoints/get-an-access-token"}]},{"group":"2D Barcodes","icon":"qrcode","pages":[{"title":"Generate 2D barcode","openapi":"openapi.json POST /code","href":"/api-reference/endpoints/generate-code"},{"title":"Render 2D barcode","openapi":"openapi.json POST /code/render","description":"Render one validated code definition as SVG.\n\nSet `compression` on each definition to `EPC_BASE64` or `EPC_HEX` for a compressed Digital Link. Omit or send null for an uncompressed URI. Compression requires a GTIN and serial number.","href":"/api-reference/endpoints/render-code"},{"title":"Batch Generate 2D barcodes","openapi":"openapi.json POST /codes","href":"/api-reference/endpoints/generate-codes"},{"title":"Batch Render 2D barcodes","openapi":"openapi.json POST /codes/render/batch","href":"/api-reference/endpoints/render-codes"}]},{"group":"GS1 Resolver","icon":"link","pages":[{"title":"GS1 Digital Link resolver","sidebarTitle":"Overview","href":"/api-reference/resolver/overview"},{"title":"Resolve a GS1 Digital Link","openapi":"openapi.json GET /01/{gtin}","href":"/api-reference/resolver/resolve-gtin"},{"title":"Resolve a compressed GS1 Digital Link","api":"GET https://thingidentity.com/{compressedLink}","href":"/api-reference/resolver/resolve-compressed"}]}]}]},"title":"Generate 2D barcode - Thing Identity","buildId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","deploymentId":"dpl_2oYXwqkEXirXBPk8wV1FtM5USFWi","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-WRhTSUDL.js","utils-ChMov4Kr.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-_REmC2bI.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-Bp6nVRCu.js","snippetPresets-DZadmXoU.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-CY2WdoTl.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-DwYG-Q4l.js","shallow-BXQIGwv4.js","getApiPlaygroundDisplay-CK5nK5B9.js","CodeSnippet-TH4a2aGW.js","CodeSnippets-DwsQiOFS.js","Page-R3M_BF4L.js","getPastedJson-DD7kUzi_.js","icon-holE3QoJ.js","MethodPill-DUW0T8us.js","DuplicateIcon-CI_p4be-.js","createIcon-BdbRvavb.js","DynamicMarkdown-DN96a4Ur.js","SectionHeading-SCu36A9d.js","axios-vUo_bRtp.js","Markdown-CCeGv-zI.js","clsx-BGBGWFTt.js","lib--scc4DXi.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-Cv_O2fky.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-2C5OB2eV.js"]}