> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thingidentity.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Batch Render 2D barcodes

> Render up to 10 code definitions as Base64-encoded SVG images in one JSON response.

Render up to **10 codes** in one request. The response has the same `codes` and `errors`
structure as [batch generation](/api-reference/endpoints/generate-codes).
Each successful code also contains `image`, the SVG document encoded as Base64.

## Request

```json theme={null}
{
  "codes": [
    {
      "reference": "product-label",
      "mode": "QR_GS1_DIGITAL_LINK_URI",
      "digitalLinkStem": "https://gtin.at",
      "primaryKey": { "key": "01", "value": "09521234543213" },
      "ais": [{ "key": "10", "value": "LOT42" }]
    }
  ]
}
```

The same modes, optional parameters and QR correction levels as
[single rendering](/api-reference/endpoints/render-code) apply.
QR correction defaults to `L`. This endpoint requires `write:codes`.

## Results

Successful entries contain `reference`, `barcodeText`, `hri` and `image`.
Decode the Base64 value in `image` to UTF-8 SVG bytes and save them as an `.svg` file.

Invalid items appear in `errors` with `reference` and an `errors` list containing
`code`, `path` and `args`. They do not prevent other items from rendering.
The response remains `200 OK`, including when all items fail.

Your `reference` is echoed unchanged. If omitted or null, the original zero-based position
is returned as a string. Empty references are preserved.

More than 10 items returns `422` with `Validation.TooMany.codes` before any rendering starts.


## OpenAPI

````yaml openapi.json POST /codes/render/batch
openapi: 3.1.0
info:
  title: Thing Identity Public API
  version: 1.0.0
  description: >-
    Machine-to-machine API for Thing Identity. Authenticate with client
    credentials, then call the endpoints below with the resulting bearer token.
servers:
  - url: https://api.thingidentity.com
security:
  - bearerAuth: []
tags:
  - name: Authentication
    description: Exchange client credentials for an access token.
  - name: Codes
    description: Generate GS1 barcode payloads and GS1 Digital Link URIs.
paths:
  /codes/render/batch:
    post:
      tags:
        - Codes
      summary: Batch Render 2D barcodes
      description: >-
        Render up to 10 code definitions as Base64-encoded SVG images in one
        JSON response.
      operationId: renderCodes
      requestBody:
        required: true
        content:
          application/vnd.thingidentity.public.v1+json:
            schema:
              $ref: '#/components/schemas/RenderCodesRequest'
            example:
              codes:
                - reference: product-label
                  mode: QR_GS1_DIGITAL_LINK_URI
                  digitalLinkStem: https://gtin.at
                  primaryKey:
                    key: '01'
                    value: '09521234543213'
                  ais:
                    - key: '10'
                      value: LOT42
          application/json:
            schema:
              $ref: '#/components/schemas/RenderCodesRequest'
            example:
              codes:
                - reference: product-label
                  mode: QR_GS1_DIGITAL_LINK_URI
                  digitalLinkStem: https://gtin.at
                  primaryKey:
                    key: '01'
                    value: '09521234543213'
                  ais:
                    - key: '10'
                      value: LOT42
      responses:
        '200':
          description: >-
            Successful codes and per-item errors. Inspect errors even when the
            HTTP status is 200.
          content:
            application/vnd.thingidentity.public.v1+json:
              schema:
                $ref: '#/components/schemas/RenderCodesResponse'
              example:
                codes:
                  - reference: product-label
                    barcodeText: https://gtin.at/01/09521234543213/10/LOT42
                    hri: (01)09521234543213(10)LOT42
                    image: >-
                      PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgdmlld0JveD0iMCAwIDE4IDE4Ij48bWV0YWRhdGEgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIj48ZGM6Y3JlYXRvcj5UaGluZyBJZGVudGl0eTwvZGM6Y3JlYXRvcj48ZGM6c291cmNlPmh0dHBzOi8vdGhpbmdpZGVudGl0eS5jb208L2RjOnNvdXJjZT48L21ldGFkYXRhPjxyZWN0IHdpZHRoPSIxOCIgaGVpZ2h0PSIxOCIgZmlsbD0iI0ZGRkZGRiIvPjxwYXRoIGZpbGw9IiMwMDAwMDAiIGQ9Ik0xLDFoMXYxaC0xek0zLDFoMXYxaC0xek01LDFoMXYxaC0xek03LDFoMXYxaC0xek05LDFoMXYxaC0xek0xMSwxaDF2MWgtMXpNMTMsMWgxdjFoLTF6TTE1LDFoMXYxaC0xek0xLDJoMnYxaC0yek01LDJoNHYxaC00ek0xMCwyaDJ2MWgtMnpNMTUsMmgydjFoLTJ6TTEsM2gxdjJoLTF6TTUsM2gxdjFoLTF6TTcsM2gydjJoLTJ6TTEyLDNoMXYxaC0xek0zLDRoMnYxaC0yek0xMCw0aDF2MWgtMXpNMTIsNGgydjFoLTJ6TTE2LDRoMXYxaC0xek0xLDVoM3YxaC0zek01LDVoMnYxaC0yek05LDVoMXYxaC0xek0xMiw1aDR2MWgtNHpNMSw2aDF2MmgtMXpNMyw2aDF2MmgtMXpNNiw2aDJ2MWgtMnpNOSw2aDJ2MWgtMnpNMTIsNmg1djFoLTV6TTYsN2gzdjFoLTN6TTExLDdoMXYxaC0xek0xNCw3aDF2MWgtMXpNMSw4aDR2MWgtNHpNNyw4aDV2MWgtNXpNMTYsOGgxdjFoLTF6TTEsOWgxdjFoLTF6TTksOWgxdjFoLTF6TTExLDloMXYxaC0xek0xMyw5aDN2MWgtM3pNMSwxMGgydjFoLTJ6TTYsMTBoMnYxaC0yek0xMCwxMGgxdjJoLTF6TTEzLDEwaDR2MWgtNHpNMSwxMWgxdjFoLTF6TTQsMTFoMXYxaC0xek04LDExaDF2MWgtMXpNMTQsMTFoMXYxaC0xek0xLDEyaDV2MWgtNXpNNywxMmgxdjFoLTF6TTksMTJoMXYxaC0xek0xMSwxMmgydjFoLTJ6TTE1LDEyaDJ2MWgtMnpNMSwxM2gydjFoLTJ6TTUsMTNoM3YxaC0zek05LDEzaDJ2MWgtMnpNMTQsMTNoMXYxaC0xek0xLDE0aDF2MWgtMXpNNCwxNGgzdjFoLTN6TTEwLDE0aDV2MWgtNXpNMTYsMTRoMXYxaC0xek0xLDE1aDJ2MWgtMnpNOCwxNWgydjFoLTJ6TTEyLDE1aDF2MWgtMXpNMTUsMTVoMXYxaC0xek0xLDE2aDE2djFoLTE2eiIvPjwvc3ZnPg==
                errors: []
            application/json:
              schema:
                $ref: '#/components/schemas/RenderCodesResponse'
              example:
                codes:
                  - reference: product-label
                    barcodeText: https://gtin.at/01/09521234543213/10/LOT42
                    hri: (01)09521234543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yw5aDN2MWgtM3pNMSwxMGgydjFoLTJ6TTYsMTBoMnYxaC0yek0xMCwxMGgxdjJoLTF6TTEzLDEwaDR2MWgtNHpNMSwxMWgxdjFoLTF6TTQsMTFoMXYxaC0xek04LDExaDF2MWgtMXpNMTQsMTFoMXYxaC0xek0xLDEyaDV2MWgtNXpNNywxMmgxdjFoLTF6TTksMTJoMXYxaC0xek0xMSwxMmgydjFoLTJ6TTE1LDEyaDJ2MWgtMnpNMSwxM2gydjFoLTJ6TTUsMTNoM3YxaC0zek05LDEzaDJ2MWgtMnpNMTQsMTNoMXYxaC0xek0xLDE0aDF2MWgtMXpNNCwxNGgzdjFoLTN6TTEwLDE0aDV2MWgtNXpNMTYsMTRoMXYxaC0xek0xLDE1aDJ2MWgtMnpNOCwxNWgydjFoLTJ6TTEyLDE1aDF2MWgtMXpNMTUsMTVoMXYxaC0xek0xLDE2aDE2djFoLTE2eiIvPjwvc3ZnPg==
                errors: []
components:
  schemas:
    RenderCodesRequest:
      type: object
      required:
        - codes
      properties:
        codes:
          type: array
          maxItems: 10
          items:
            $ref: '#/components/schemas/BatchRenderCodeDefinition'
    RenderCodesResponse:
      type: object
      required:
        - codes
        - errors
      properties:
        codes:
          type: array
          items:
            $ref: '#/components/schemas/RenderedCode'
        errors:
          type: array
          items:
            $ref: '#/components/schemas/GenerateCodeFailure'
    BatchRenderCodeDefinition:
      allOf:
        - $ref: '#/components/schemas/RenderCodeRequest'
        - type: object
          properties:
            reference:
              type:
                - string
                - 'null'
              description: >-
                Optional correlation identifier, echoed unchanged on success or
                failure. When omitted or null, the API returns the zero-based
                input position as a string, e.g. 0 becomes "0". Empty strings
                are preserved. Avoid collisions with generated references. This
                is not an idempotency key.
              examples:
                - product-label
    RenderedCode:
      allOf:
        - $ref: '#/components/schemas/GeneratedCode'
        - type: object
          required:
            - image
          properties:
            image:
              type: string
              format: byte
              contentEncoding: base64
              contentMediaType: image/svg+xml
              description: Base64-encoded SVG document (UTF-8).
    GenerateCodeFailure:
      type: object
      required:
        - reference
        - errors
      properties:
        reference:
          type: string
          description: >-
            The supplied reference unchanged, or the zero-based input position
            as a string when omitted or null.
        errors:
          type: array
          items:
            type: object
            required:
              - code
              - args
            properties:
              code:
                type: string
                description: '`Validation.Invalid.<field>`.'
                examples:
                  - Validation.Invalid.primaryKey
              path:
                type:
                  - string
                  - 'null'
                description: The field at fault, so `ais.2` is the third entry of `ais`.
                examples:
                  - primaryKey
              args:
                type: array
                items:
                  type: string
    RenderCodeRequest:
      example:
        mode: QR_GS1_DIGITAL_LINK_URI
        digitalLinkStem: https://gtin.at
        primaryKey:
          key: '01'
          value: '09521234543213'
        ais:
          - key: '10'
            value: LOT42
      type: object
      required:
        - mode
        - primaryKey
      properties:
        mode:
          type: string
          enum:
            - GS1_DATAMATRIX
            - DATAMATRIX_GS1_DIGITAL_LINK_URI
            - GS1_QR
            - QR_GS1_DIGITAL_LINK_URI
          example: QR_GS1_DIGITAL_LINK_URI
          description: Barcode type. Digital Link modes require digitalLinkStem.
        errorCorrectionLevel:
          type:
            - string
            - 'null'
          enum:
            - L
            - M
            - Q
            - H
            - null
          description: >-
            QR only: L, M, Q or H. Omitted or null selects L for QR. For Data
            Matrix omit or send null.
        primaryKey:
          allOf:
            - $ref: '#/components/schemas/Ai'
          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.


            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.
        ais:
          type:
            - array
            - 'null'
          description: >-
            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.
          items:
            $ref: '#/components/schemas/Ai'
        extensionParameters:
          type:
            - array
            - 'null'
          description: >-
            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.
          items:
            $ref: '#/components/schemas/ExtensionParameter'
        digitalLinkStem:
          type:
            - string
            - '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
        linkType:
          type:
            - string
            - '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
        context:
          type:
            - string
            - 'null'
          description: >-
            Value for the GS1 Digital Link `context` query parameter. Only with
            a `digitalLinkStem`, same character rules as extension parameter
            values.
          examples:
            - dpp
    GeneratedCode:
      type: object
      required:
        - reference
        - barcodeText
        - hri
      properties:
        reference:
          type: string
          description: >-
            The supplied reference unchanged, or the zero-based input position
            as a string when omitted or null.
        barcodeText:
          type: string
          description: >-
            The payload to encode. With a `digitalLinkStem` the GS1 Digital Link
            URI; without one, the GS1 element string, where parentheses inside a
            value are escaped as `^040` and `^041` so that a renderer places the
            FNC1 separators correctly.
          examples:
            - https://gtin.at/01/09521234543213
        hri:
          type: string
          description: >-
            Human readable interpretation, the `(AI)value` text printed under
            the symbol.
          examples:
            - (01)09521234543213
    Ai:
      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'
    ExtensionParameter:
      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
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: The `access_token` from `POST /oauth/token`.

````