curl --request POST \
--url https://www.closient.com/products/api/v1/barcode/ \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"barcode_type": "auto",
"format": "svg",
"gtin": "00012345678905"
}
'import requests
url = "https://www.closient.com/products/api/v1/barcode/"
payload = {
"barcode_type": "auto",
"format": "svg",
"gtin": "00012345678905"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({barcode_type: 'auto', format: 'svg', gtin: '00012345678905'})
};
fetch('https://www.closient.com/products/api/v1/barcode/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.closient.com/products/api/v1/barcode/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'barcode_type' => 'auto',
'format' => 'svg',
'gtin' => '00012345678905'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.closient.com/products/api/v1/barcode/"
payload := strings.NewReader("{\n \"barcode_type\": \"auto\",\n \"format\": \"svg\",\n \"gtin\": \"00012345678905\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.closient.com/products/api/v1/barcode/")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"barcode_type\": \"auto\",\n \"format\": \"svg\",\n \"gtin\": \"00012345678905\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.closient.com/products/api/v1/barcode/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"barcode_type\": \"auto\",\n \"format\": \"svg\",\n \"gtin\": \"00012345678905\"\n}"
response = http.request(request)
puts response.read_body"<string>"{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}Generate a single 1D barcode
Render a 1D barcode for a GTIN. Symbology is auto-selected from GTIN length unless overridden via barcode_type. Returns image bytes (image/svg+xml, image/png, application/postscript, or application/pdf).
Caching: responses are deterministic given the request body. The endpoint sets Cache-Control: public, max-age=2592000 (30 days) and a strong ETag over the image bytes. Clients sending If-None-Match with a matching ETag get 304 Not Modified.
curl --request POST \
--url https://www.closient.com/products/api/v1/barcode/ \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"barcode_type": "auto",
"format": "svg",
"gtin": "00012345678905"
}
'import requests
url = "https://www.closient.com/products/api/v1/barcode/"
payload = {
"barcode_type": "auto",
"format": "svg",
"gtin": "00012345678905"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({barcode_type: 'auto', format: 'svg', gtin: '00012345678905'})
};
fetch('https://www.closient.com/products/api/v1/barcode/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://www.closient.com/products/api/v1/barcode/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'barcode_type' => 'auto',
'format' => 'svg',
'gtin' => '00012345678905'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://www.closient.com/products/api/v1/barcode/"
payload := strings.NewReader("{\n \"barcode_type\": \"auto\",\n \"format\": \"svg\",\n \"gtin\": \"00012345678905\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://www.closient.com/products/api/v1/barcode/")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"barcode_type\": \"auto\",\n \"format\": \"svg\",\n \"gtin\": \"00012345678905\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.closient.com/products/api/v1/barcode/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"barcode_type\": \"auto\",\n \"format\": \"svg\",\n \"gtin\": \"00012345678905\"\n}"
response = http.request(request)
puts response.read_body"<string>"{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}{
"detail": "The requested resource was not found.",
"error_code": "not_found",
"retryable": false,
"status": 404,
"timestamp": "2026-03-31T12:00:00+00:00",
"title": "Not Found",
"type": "https://closient.com/docs/errors/not_found"
}Authorizations
Body
Request body for synchronous 1D barcode generation.
GTIN (8/12/13/14 digits) or AI-bracketed string for GS1-128.
Symbology. auto picks the right family from GTIN length.
auto, ean13, ean8, jan, upca, upce, itf14, ean14, code128, gs1_128, code39 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.
svg, png, eps, pdf 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.
0.1 <= x <= 2Symbol height in millimeters. Default 25.0mm matches GS1 retail minimum. Reduce for compact labels; increase for warehouse-scan distance.
1 <= x <= 100Human-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.
4 <= x <= 24Quiet 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.
0 <= x <= 20Render the human-readable GTIN below the bars. 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.