Barcode API

Generate PNG or SVG labels for inventory and packaging. Select a supported symbology and keep identifiers as strings to preserve leading zeros.

On this page

Request and response

Send authenticated JSON to POST /v1/projects/{projectId}/tools/barcode. Required fields are type and string content. Output is PNG by default; SVG is also supported. Generation consumes one credit and returns transient binary media.

Imazeo renders your identifier. It does not assign retail product numbers or verify registration with an identifier authority.

Choose a symbology

typecontent
code1281–80 characters
code391–48 uppercase letters, digits, space and - . $ / + %
ean1312 data digits or 13 digits including checksum
ean87 data digits or 8 including checksum
upca11 data digits or 12 including checksum
itf1413 data digits or 14 including checksum

For numeric symbologies, an omitted check digit is computed; a supplied invalid checksum is rejected. All content is additionally subject to the configured byte cap. Send "001234567890" as a string, not a number.

Parameters and defaults

FieldType / valuesContract
typecode128 | code39 | ean13 | ean8 | upca | itf14Required. Barcode symbology.
contentstringRequired. Up to 80 characters. Text to encode (a string preserves leading zeroes). code128: 1–80 characters; code39: 1–48 uppercase letters/digits or - . space $ / + %. ean13: 12/13 digits; ean8: 7/8; upca: 11/12; itf14: 13/14. Omit the check digit to compute it; supplied check digits must be valid.
formatpng | svgOptional. Default: png.
scaleintegerOptional. Default: 2. Min 1. Max 6. Integer rendering scale factor.
heightintegerOptional. Default: 10. Min 4. Max 40. Bar height in millimetres before scaling.
includeTextbooleanOptional. Default: true. Display human-readable content below the bars.
foregroundstringOptional. Default: #000000. Foreground hex colour (#RGB or #RRGGBB).
backgroundstringOptional. Default: #ffffff. Background hex colour (#RGB or #RRGGBB).

scale is an integer from 1–6, default 2. height is an integer from 4–40 millimetres before scaling, default 10. includeText is a JSON boolean, default true. Format is png or svg; colors are hexadecimal. Omit unused fields rather than sending null.

Example: a warehouse shelf label

cURL example
curl --fail-with-body --silent --show-error "$IMAZEO_API_ORIGIN/v1/projects/$IMAZEO_PROJECT_ID/tools/barcode" \
  -H "X-API-Key: $IMAZEO_API_KEY" -H 'Content-Type: application/json' \
  --data '{"type":"code128","content":"WH-0042-BIN-07","format":"svg","scale":3,"height":12,"includeText":true}' --dump-header barcode-headers.txt --output shelf-label.svg
Successful response shape (body abbreviated)
HTTP/1.1 200 OK
Content-Type: image/svg+xml
X-Request-Id: example-barcode-request

<svg …>…</svg>

Validate with the scanner, printer, substrate and physical size you will use. Do not distort the barcode’s proportions in CSS or a print template. The returned bytes can be saved separately through private artifacts.

Documentation reviewed 2026-10-03 against development backend e298ec7. Verify your deployment’s API origin and limits before integrating.