Open Application Platform Docs

Barcodes (beta)

Draw a barcode or a QR, Data Matrix or PDF417 code as an image.

label.barcode Beta call

How to call it

REST

POST /v1/label/barcode

GraphQL

query openBarcode

MCP

open_label_barcode

Draw one barcode (Code 128, Code 39, Code 93, EAN-13, EAN-8, UPC-A, UPC-E, ITF, Codabar, Code 11) or 2D code (QR, Data Matrix, PDF417) as a PNG image or an SVG. Billed one call.

Request schema

Generated from the same validation rules the endpoint runs, so a field cannot be documented without being validated.

POST /v1/label/barcode

{
    "type": "object",
    "properties": {
        "error_correction": {
            "type": [
                "string",
                "null"
            ],
            "enum": [
                "L",
                "M",
                "Q",
                "H"
            ]
        },
        "format": {
            "type": [
                "string",
                "null"
            ],
            "enum": [
                "png",
                "svg"
            ]
        },
        "height": {
            "type": [
                "integer",
                "null"
            ],
            "minimum": 10,
            "maximum": 600
        },
        "module": {
            "type": [
                "integer",
                "null"
            ],
            "minimum": 1,
            "maximum": 20
        },
        "quiet_zone": {
            "type": [
                "boolean",
                "null"
            ]
        },
        "symbology": {
            "type": [
                "string",
                "null"
            ],
            "enum": [
                "code128",
                "code39",
                "code93",
                "ean13",
                "ean8",
                "upca",
                "upce",
                "itf",
                "codabar",
                "code11",
                "qr",
                "datamatrix",
                "pdf417"
            ]
        },
        "text": {
            "type": [
                "boolean",
                "null"
            ]
        },
        "value": {
            "type": "string",
            "maxLength": 1000
        }
    },
    "additionalProperties": false,
    "required": [
        "value"
    ]
}

Request example

{
    "value": "1Z999AA10123456784",
    "symbology": "code128",
    "text": true
}

Response

What a successful call returns: the schema of `data` and `meta`, with a description of each field, followed by an example response from a real call.

POST /v1/label/barcode

Response schema

{
    "description": "The drawn code. Billed one call.",
    "data": {
        "type": "object",
        "properties": {
            "symbology": {
                "type": "string",
                "description": "The symbology drawn."
            },
            "value": {
                "type": "string",
                "description": "The value written."
            },
            "content_type": {
                "type": "string",
                "enum": [
                    "image/png",
                    "image/svg+xml"
                ],
                "description": "What was drawn."
            },
            "width": {
                "type": "integer",
                "description": "Image width in pixels. PNG only."
            },
            "height": {
                "type": "integer",
                "description": "Image height in pixels. PNG only."
            },
            "image_base64": {
                "type": "string",
                "description": "The PNG, base64. PNG only."
            },
            "svg": {
                "type": "string",
                "description": "The SVG markup. SVG only."
            }
        },
        "required": [
            "symbology",
            "value",
            "content_type"
        ]
    },
    "meta": {
        "type": "object",
        "properties": {},
        "additionalProperties": true
    }
}

Response example

{
    "request_id": "req_01k8zq3m5n7p9r1t3v5x7z9b2d",
    "capability": "label.barcode",
    "billing": {
        "unit": "call",
        "quantity": 1,
        "counted": true
    },
    "data": {
        "symbology": "code128",
        "value": "1Z999AA10123456784",
        "content_type": "image/png",
        "width": 440,
        "height": 100,
        "image_base64": "iVBORw0KGgoAAAANSUhEUgAAAbgAAABkCAIAAAB7I7IEAAAACXBIWXMAAA7EAAAOxAGVKw4bAAAC0klEQVR4nO3d0W6yMACGYfiz+79l/gMS0ljar8icpj7P0Ya1VDbfQTDZum3bAkDbv3cvAODTCSVAIJQAgVACBEIJEAglQCCUAIFQAgRCCRAIJUAglACBUAIEQgkQCCVAIJQAgVACBEIJEAglQCCUAMHPnSev63p8vf/vnX1L+X946i31DPX4UuvRco/1+Hpka78je+zP+TkztH4K9V5Gjsn9GepXVG9vPTryW9T/fbt/tEdeXf8o9ce0ZuvP35ph5DjUq7r6Dhp/z46scOQ1tsaM77e/lxHOKAECoQQIhBIgEEqAQCgBAqEECIQSIBBKgEAoAQKhBAiEEiAQSoBAKAECoQQIhBIgEEqAQCgBAqEECIQSIBBKgEAoAQKhBAiEEiAQSoBAKAECoQQIhBIgEEqAQCgBAqEECIQSIBBKgEAoAQKhBAiEEiAQSoBAKAECoQQIhBIgEEqAQCgBAqEECIQSIBBKgEAoAQKhBAiEEiBYt2179xoAPpozSoDg590L4IXWdV2W5bho2L8t7Q+V208H/9bGekn3R7ae/jDJ+Gu/dJQ6q2UmLr2ndbyxT3/EDwUpW/CijadLujmy9fT6CJyGrP/053ZUH2om4NJ7Tuva+xP4ltOf/pKeG7ltW2tkfWK4b9yNTDV4lE5nYzIuvef0aZWMe+xf2Hae3rker6+4j1PCssUj54P7VJ3zXLmcm1B+l7qSDwm4urGcdmRja1WDralTVTarnOehev0ILo16ti78OztiSkL5RVpv7Jv3apaiIHHjqfFL8quD/4BzyW8glN8u3uXob/wz40s6vc3yRGTj4NYdeebjrvecTj/j8oqPB129FT6y9/uLP5zeSR98madRHtkR8xFKgMDHgwACoQQIhBIgEEqAQCgBAqEECIQSIBBKgEAoAQKhBAiEEiAQSoBAKAECoQQIhBIgEEqAQCgBAqEECIQSIBBKgEAoAYL/0ZAf9Hxdf0cAAAAASUVORK5CYII="
    },
    "meta": {
        "format": "png"
    }
}

What it costs

One call, whatever its size.

Every billable response carries a billing block with the unit, the quantity and how the quantity was derived.

Errors it can return

Status Code Description
401 TOKEN_INVALID Unknown or revoked API token.
401 TOKEN_MISSING No API token. Send Authorization: Bearer <your token>.
402 QUOTA_EXHAUSTED The included allowance for this capability is used up for the current period.
403 CAPABILITY_NOT_ENABLED This capability is not enabled for your account. See :doc to enable it.
403 CAPABILITY_NOT_GRANTED_TO_KEY Your account has this capability, but this API key was not granted it.
403 OPEN_API_DISABLED Open Platform access is not enabled for this account.
422 VALIDATION_FAILED The request failed validation. See details.
429 RATE_LIMITED Too many requests. Please retry after the indicated delay.
500 INTERNAL_ERROR An unexpected error occurred. Quote the request_id when contacting support.