curl --request POST \
--url https://www.closient.com/products/api/v1/datamatrix/ \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"gtin": "<string>",
"lot": "<string>",
"serial": "<string>",
"expiry": "<string>",
"format": "svg"
}
'import requests
url = "https://www.closient.com/products/api/v1/datamatrix/"
payload = {
"gtin": "<string>",
"lot": "<string>",
"serial": "<string>",
"expiry": "<string>",
"format": "svg"
}
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({
gtin: '<string>',
lot: '<string>',
serial: '<string>',
expiry: '<string>',
format: 'svg'
})
};
fetch('https://www.closient.com/products/api/v1/datamatrix/', 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/datamatrix/",
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([
'gtin' => '<string>',
'lot' => '<string>',
'serial' => '<string>',
'expiry' => '<string>',
'format' => 'svg'
]),
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/datamatrix/"
payload := strings.NewReader("{\n \"gtin\": \"<string>\",\n \"lot\": \"<string>\",\n \"serial\": \"<string>\",\n \"expiry\": \"<string>\",\n \"format\": \"svg\"\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/datamatrix/")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"gtin\": \"<string>\",\n \"lot\": \"<string>\",\n \"serial\": \"<string>\",\n \"expiry\": \"<string>\",\n \"format\": \"svg\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.closient.com/products/api/v1/datamatrix/")
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 \"gtin\": \"<string>\",\n \"lot\": \"<string>\",\n \"serial\": \"<string>\",\n \"expiry\": \"<string>\",\n \"format\": \"svg\"\n}"
response = http.request(request)
puts response.read_body"<string>"{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"error_code": "<string>",
"timestamp": "<string>",
"retryable": false,
"retry_after": 123,
"owner_action_required": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"error_code": "<string>",
"timestamp": "<string>",
"retryable": false,
"retry_after": 123,
"owner_action_required": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"error_code": "<string>",
"timestamp": "<string>",
"retryable": false,
"retry_after": 123,
"owner_action_required": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"error_code": "<string>",
"timestamp": "<string>",
"retryable": false,
"retry_after": 123,
"owner_action_required": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"error_code": "<string>",
"timestamp": "<string>",
"retryable": false,
"retry_after": 123,
"owner_action_required": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"error_code": "<string>",
"timestamp": "<string>",
"retryable": false,
"retry_after": 123,
"owner_action_required": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"error_code": "<string>",
"timestamp": "<string>",
"retryable": false,
"retry_after": 123,
"owner_action_required": true,
"details": "<unknown>"
}Generate a single GS1 DataMatrix
Render a GS1 DataMatrix for a GTIN plus any subset of (lot, serial, expiry). At least one of lot or serial is required. Returns image bytes (image/svg+xml, image/png, 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/datamatrix/ \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"gtin": "<string>",
"lot": "<string>",
"serial": "<string>",
"expiry": "<string>",
"format": "svg"
}
'import requests
url = "https://www.closient.com/products/api/v1/datamatrix/"
payload = {
"gtin": "<string>",
"lot": "<string>",
"serial": "<string>",
"expiry": "<string>",
"format": "svg"
}
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({
gtin: '<string>',
lot: '<string>',
serial: '<string>',
expiry: '<string>',
format: 'svg'
})
};
fetch('https://www.closient.com/products/api/v1/datamatrix/', 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/datamatrix/",
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([
'gtin' => '<string>',
'lot' => '<string>',
'serial' => '<string>',
'expiry' => '<string>',
'format' => 'svg'
]),
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/datamatrix/"
payload := strings.NewReader("{\n \"gtin\": \"<string>\",\n \"lot\": \"<string>\",\n \"serial\": \"<string>\",\n \"expiry\": \"<string>\",\n \"format\": \"svg\"\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/datamatrix/")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"gtin\": \"<string>\",\n \"lot\": \"<string>\",\n \"serial\": \"<string>\",\n \"expiry\": \"<string>\",\n \"format\": \"svg\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.closient.com/products/api/v1/datamatrix/")
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 \"gtin\": \"<string>\",\n \"lot\": \"<string>\",\n \"serial\": \"<string>\",\n \"expiry\": \"<string>\",\n \"format\": \"svg\"\n}"
response = http.request(request)
puts response.read_body"<string>"{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"error_code": "<string>",
"timestamp": "<string>",
"retryable": false,
"retry_after": 123,
"owner_action_required": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"error_code": "<string>",
"timestamp": "<string>",
"retryable": false,
"retry_after": 123,
"owner_action_required": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"error_code": "<string>",
"timestamp": "<string>",
"retryable": false,
"retry_after": 123,
"owner_action_required": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"error_code": "<string>",
"timestamp": "<string>",
"retryable": false,
"retry_after": 123,
"owner_action_required": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"error_code": "<string>",
"timestamp": "<string>",
"retryable": false,
"retry_after": 123,
"owner_action_required": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"error_code": "<string>",
"timestamp": "<string>",
"retryable": false,
"retry_after": 123,
"owner_action_required": true,
"details": "<unknown>"
}{
"type": "<string>",
"title": "<string>",
"status": 123,
"detail": "<string>",
"error_code": "<string>",
"timestamp": "<string>",
"retryable": false,
"retry_after": 123,
"owner_action_required": true,
"details": "<unknown>"
}Authorizations
Body
Request body for synchronous GS1 DataMatrix generation.
GTIN (8/12/13/14 digits, normalized to GTIN-14).
Optional GS1 AI(10) lot/batch (1-20 printable ASCII).
Optional GS1 AI(21) serial (1-20 printable ASCII).
Optional GS1 AI(17) expiry as YYMMDD (e.g. '270630' for 2027-06-30).
Output image format. svg is the default scalable vector output; png is raster output; pdf is single-page vector PDF for print workflows (C-2852) — path operators in the content stream rather than a rasterised preview, so a print shop can scale to its target label size at the press.
svg, png, pdf Response
OK
The response is of type file.