Skip to main content
POST
/
products
/
api
/
v1
/
barcode
Generate a single 1D barcode
curl --request POST \
  --url https://www.closient.com/products/api/v1/barcode/ \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "gtin": "<string>",
  "barcode_type": "auto",
  "format": "svg",
  "module_width": 0.33,
  "module_height": 25,
  "font_size": 10,
  "quiet_zone": 6.5,
  "write_text": true,
  "embed_font": true
}
'
"<string>"

Documentation Index

Fetch the complete documentation index at: https://docs.closient.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

X-API-Key
string
header
required

Body

application/json

Request body for synchronous 1D barcode generation.

gtin
string
required

GTIN (8/12/13/14 digits) or AI-bracketed string for GS1-128.

barcode_type
enum<string>
default:auto

Symbology. auto picks the right family from GTIN length.

Available options:
auto,
ean13,
ean8,
jan,
upca,
upce,
itf14,
ean14,
code128,
gs1_128,
code39
format
enum<string>
default:svg

Output image format. svg is scalable vector output with embedded OCR-B HRT glyphs (the preferred print-shop format); png is raster output; eps is PostScript for legacy label-printer drivers; pdf (C-2852) is vector PDF for print houses — the SVG goes through svglib + reportlab so the PDF contains path operators, not a rasterised preview.

Available options:
svg,
png,
eps,
pdf
module_width
number
default:0.33

Module (narrowest bar) width in millimeters. Default 0.33mm matches GS1 retail-scan recommendations. Increase to ~0.5-1.0mm for outer-case ITF-14 / shipping containers.

Required range: 0.1 <= x <= 2
module_height
number
default:25

Symbol height in millimeters. Default 25.0mm matches GS1 retail minimum. Reduce for compact labels; increase for warehouse-scan distance.

Required range: 1 <= x <= 100
font_size
number
default:10

Human-readable text size in points. Default 10pt. Values below 8pt switch Zint to its compact-text rendering (--small); values 8pt and above render at standard size.

Required range: 4 <= x <= 24
quiet_zone
number
default:6.5

Quiet zone (white margin around the symbol) in millimeters. Default 6.5mm matches GS1 retail recommendations. Set to 0 to disable the quiet-zone markers entirely.

Required range: 0 <= x <= 20
write_text
boolean
default:true

Render the human-readable GTIN below the bars. Default true.

embed_font
boolean
default:true

Embed the OCR-B font in SVG output for portable rendering. Default true. No effect on PNG / EPS output.

Response

OK

The response is of type file.