Integrating e-label services
Atomic Systems services send product data as JSON. The generator validates it against GS1 rules, the user sees the finished codes and the files (SVG, PNG, JPG, JSON-LD) can be returned to the source service.
https://www.gs1.atomicsystems.pl/api/v1 · Currently enabled fields: name, gtin, production_date (set by the administrator)Data model (product object)
Field names as in the desktop program and CSV files. Dates always YYYY-MM-DD. Fields disabled by the administrator are dropped (warning fields_disabled). Order in the code is fixed.
| Field | AI | Description | Aliases |
|---|---|---|---|
name | — | Product name, max 100 chars (not encoded – JSON-LD only) | product_name, productName, title |
gtin | 01 | GTIN-8/12/13/14 with valid check digit | gtin14, ean, 01 |
variant (disabled) | 22 | Variant, max 20 CSET 82 chars | 22, cpv |
batch (disabled) | 10 | Batch/lot, max 20 CSET 82 chars | lot, batch_lot, 10 |
serial (disabled) | 21 | Serial, max 20 CSET 82 chars | serial_number, sn, 21 |
order (disabled) | 400 | Order number, max 30 chars | order_number, 400 |
country (disabled) | 422 | Country of origin, ISO 3166 numeric (e.g. 616) | country_of_origin, origin, 422 |
production_date | 11 | Production date YYYY-MM-DD | productionDate, prod_date, 11 |
packaging_date (disabled) | 13 | Packaging date | packagingDate, pack_date, 13 |
best_before (disabled) | 15 | Best before | bestBefore, bbd, 15 |
sell_by (disabled) | 16 | Sell by | sellBy, 16 |
expiry (disabled) | 17 | Expiration date | expiry_date, expiration_date, expirationDate, use_by |
weight (disabled) | 310n | Net weight in kg, up to 5 decimals (e.g. "2.5") | net_weight, netWeight, weight_kg |
domain | DL | GS1 Digital Link domain (https://…); default https://id.gs1.org |
Full request object
{
"lang": "pl", // kod jednego z 24 języków UE (bg…sv) – język strony generatora
"reference": "WINE-2025-0042", // własny identyfikator (wraca w wynikach)
"return_url": "https://winelabel.atomicsystems.pl/label/42", // powrót po zapisaniu kodów
"domain": "https://id.example.com", // opcjonalnie
"product": {
"name": "Rioja Reserva 2019",
"gtin": "5901234123457",
"production_date": "2025-11-30",
"batch": "L2025-11"
},
"options": { // opcjonalnie – nadpisuje ustawienia domyślne
"kinds": ["gs1_datamatrix", "gs1_qr", "dl_datamatrix", "dl_qr"],
"formats": ["svg", "png", "jpg"], "write_json": true,
"ecc": "Q", "module_px": 10,
"print": false, "module_mm": 0.5, "dpi": 300,
"hri": true, "hri_position": "below", "hri_scope": "all", "hri_px": 40, "hri_mm": 2.0
},
"strict": false // true = odrzuć (422), gdy dane są błędne
}
1. Simplest integration – browser form
No server code and no API key. The service must be on the trusted list. The browser posts JSON in the payload field and lands in the generator with the data filled in.
<form method="post" action="https://www.gs1.atomicsystems.pl/api/v1/jobs" target="_blank">
<input type="hidden" name="payload" id="gs1payload">
<button>Generuj kody GS1</button>
</form>
<script>
document.getElementById("gs1payload").value = JSON.stringify({
lang: "pl",
reference: "WINE-42",
return_url: location.href,
product: { name: "Rioja Reserva", gtin: "5901234123457", production_date: "2025-11-30" }
});
</script>
2. API: POST /api/v1/jobs
Server call with an API key, or browser fetch (CORS) from a trusted origin. The response contains the user link and the GS1 validation result.
curl -X POST https://www.gs1.atomicsystems.pl/api/v1/jobs \
-H "Content-Type: application/json" \
-H "X-API-Key: gs1k_…" \
-d '{"reference":"WINE-42","return_url":"https://winelabel.atomicsystems.pl/label/42",
"product":{"name":"Rioja Reserva","gtin":"5901234123457","production_date":"2025-11-30"}}'HTTP/1.1 201 Created
{
"id": "kPfi8ulN66eA-oaeyvWuDw",
"url": "https://www.gs1.atomicsystems.pl/?job=kPfi8ulN66eA-oaeyvWuDw&lang=pl",
"expires_at": "…",
"validation": {
"ok": true, "errors": {},
"gtin14": "05901234123457",
"ai_string": "(01)05901234123457(11)251130",
"element_string": "010590123412345711251130",
"hri": ["(01) 05901234123457", "(11) 251130"],
"digital_link": "https://id.gs1.org/01/05901234123457?11=251130",
"jsonld": { … }, "base_name": "05901234123457_1c6f90ed"
},
"warnings": [],
"result_url": "https://www.gs1.atomicsystems.pl/api/v1/jobs/kPfi8ulN66eA-oaeyvWuDw/result"
}PHP
$ch = curl_init("https://www.gs1.atomicsystems.pl/api/v1/jobs");
curl_setopt_array($ch, [
CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => ["Content-Type: application/json", "X-API-Key: " . GS1_API_KEY],
CURLOPT_POSTFIELDS => json_encode(["reference" => $labelId, "return_url" => $backUrl, "product" => $product]),
]);
$job = json_decode(curl_exec($ch), true);
header("Location: " . $job["url"]); // użytkownik przechodzi do generatora
3. Getting the generated files
With return_url the user gets a “Save codes and return” button. Files are stored and the browser returns to return_url with a gs1_job parameter. Fetch the results with the API key:
GET https://www.gs1.atomicsystems.pl/api/v1/jobs/{id}/result → JSON: job, summary, files[] (name, mime, kind, size, sha256, data base64, url)
GET https://www.gs1.atomicsystems.pl/api/v1/jobs/{id}/result?include=meta → bez danych plików
GET https://www.gs1.atomicsystems.pl/api/v1/jobs/{id}/files/{name} → pojedynczy plik (np. …_gs1_datamatrix.svg)
DELETE https://www.gs1.atomicsystems.pl/api/v1/jobs/{id} → usunięcie zleceniaFile names as in the program: {GTIN-14}_{serial or batch}_{hash}_{kind}.{ext}. Jobs expire after 7 days.
4. Popup or iframe (postMessage)
Open the job url with window.open or in an iframe with &embed=1. On click, the generator posts the files back to the opener/parent – only to the origin that created the job:
const w = window.open(job.url + "&embed=1", "gs1", "width=1200,height=900");
window.addEventListener("message", (e) => {
if (e.origin !== "https://www.gs1.atomicsystems.pl" || e.data?.type !== "gs1-2d-codes") return;
// e.data.summary: ai_string, hri, digital_link, gtin14, product
// e.data.files: [{ name, kind, encoding: "base64", data }]
});
POST /api/v1/validate
Validation only – 200 when valid, 422 with field errors.
POST /api/v1/validate
{"lang":"pl","product":{"name":"Rioja","gtin":"5901234123458","production_date":"2025-02-30"}}
422 → {"validation":{"ok":false,"errors":{
"gtin":"Błędna cyfra kontrolna GTIN (powinna być 7)",
"production_date":"Taka data nie istnieje w kalendarzu"}, …}}
Data link (?data=)
For small payloads without server storage: Base64URL-encoded UTF-8 JSON in the data parameter.
const data = btoa(String.fromCharCode(...new TextEncoder().encode(JSON.stringify({product:{name:"Rioja",gtin:"5901234123457"}}))))
.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"");
location.href = "https://www.gs1.atomicsystems.pl/?data=" + data;
Endpoint reference
| Endpoint | Access | |
|---|---|---|
| GET | /api/v1/health | public |
| GET | /api/v1/config – fields, domain, defaults | public |
| POST | /api/v1/validate | public (rate limited) |
| POST | /api/v1/jobs | API key or trusted origin |
| GET | /api/v1/jobs/{id} | knowledge of id |
| GET | /api/v1/jobs/{id}/result, /files/{name} | API key |
| DELETE | /api/v1/jobs/{id} | API key |
Key: X-API-Key or Authorization: Bearer header (created in the admin panel). Errors: JSON {"error","message"}.