Reference of the Traceqode endpoints. All paths start with https://<your-instance>/api/v1/traceability. Every request carries Authorization: Bearer hek_…. Formats, paging, deletion lists and error codes are under Conventions.
Reading needs read access to the Traceqode module, every write needs write access (otherwise 403 with no_write_permission).
What for
A PIM or ERP keeps products, GTINs, suppliers and certifications up to date.
A lab system writes a batch’s lab values.
A label tool fetches a batch’s QR code and label.
Brand
Endpoint
Purpose
GET /brand
The Brand Settings (name, tagline, contact, colours, logo URL, languages, GS1 prefix, whether traders are shown)
PATCH /brand
Change them. The GS1 resolver’s token and endpoint are not in the API.
Products
Endpoint
Purpose
GET /products and /{product_id}
Products with GTIN and current version (description, images as URLs, ingredients, nutrition, texts). Parameters: search, limit, cursor, updated_since. from_produktion shows whether the product comes from Produktion.
POST /products
Create a product (name, slug, optionally the version fields)
PATCH /products/{product_id}
Change it. As in the app, every change makes a new current version.
POST /products/{product_id}/gtins
Give the product its GTIN (value, with check digit). A product has one GTIN. Wrong check digit: 422 with gtin_invalid; already used: 409 with gtin_taken.
GET, PUT /products/{product_id}/defaults
What new batches start with: suppliers, recipes, marketing content, packaging
GET /products/{product_id}/batches
The product’s batches
GET /products/deleted?since=…
Deletion list
Products and GTINs can’t be deleted, as in the app.
Batches
Endpoint
Purpose
GET /batches and /{batch_id}
Batches with dates, story, packaging, suppliers, recipes, marketing content and publishing state. Parameters: product_id, published.
POST /batches
Create a batch (product_id, batch_number, optionally dates, texts, packaging_id, show_traders). It starts with the product’s defaults and is not published.
PATCH /batches/{batch_id}
Change it (unpublished batches)
DELETE /batches/{batch_id}
Delete it. A published batch can’t be deleted through the API (409).
Suppliers with place, coordinates, story and parent supplier. from_produktion and incomplete (story or location missing) are read only. Parameter: search.
POST, PATCH, DELETE /suppliers…
Create, change, delete. Deleting works as in the app: sub-suppliers lose their parent, the supplier’s certifications are deleted with it.
GET /suppliers/{supplier_id}/chain
The supplier and its parents
GET /certifications, POST, PATCH, DELETE /certifications/{certification_id}
Certifications of a product, supplier or the brand (owner_typeproduct, supplier, brand, owner_id, name, issuer, expires_at, document_url). Parameters: owner_type, owner_id.
Merging a supplier from Produktion with one entered by hand is only possible in the app.
Consumer recipes with steps, ingredients and products
/packaging
Packaging with material, recycling code (e.g. GL-70, PAP-20) and disposal instructions
/marketing-content
Marketing Content with story, text and products
Each with GET (list and single), POST, PATCH, DELETE and a deletion list …/deleted?since=….
Translations
Endpoint
Purpose
GET /translations?entity_type=…&entity_id=…&language_code=en
The translated fields of one entry in one language
PUT /translations
Translate one field (entity_type, entity_id, field_name, language_code, value). An empty value removes the translation.
entity_type: brand, product, batch, supplier, marketing_content, recipe, packaging, lab_metric, recipe_ingredient. The translatable fields match the Translations section in the app. A translation counts as a change of the entry (updated_since).
Error codes
Code
Meaning
batch_published
The batch is published and frozen
gtin_invalid, gtin_taken, gtin_missing
GTIN with a wrong check digit, already used, or missing for the QR code
label_template_missing, label_not_renderable
No label template, or the label can’t be made from the batch’s data