Skip to content

Traceqode – reference

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

EndpointPurpose
GET /brandThe Brand Settings (name, tagline, contact, colours, logo URL, languages, GS1 prefix, whether traders are shown)
PATCH /brandChange them. The GS1 resolver’s token and endpoint are not in the API.

Products

EndpointPurpose
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 /productsCreate 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}/gtinsGive 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}/defaultsWhat new batches start with: suppliers, recipes, marketing content, packaging
GET /products/{product_id}/batchesThe product’s batches
GET /products/deleted?since=…Deletion list

Products and GTINs can’t be deleted, as in the app.

Batches

EndpointPurpose
GET /batches and /{batch_id}Batches with dates, story, packaging, suppliers, recipes, marketing content and publishing state. Parameters: product_id, published.
POST /batchesCreate 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).
PUT, DELETE /batches/{batch_id}/suppliers/{supplier_id}Attach or remove a supplier; likewise recipes/{recipe_id} and marketing-content/{content_id}
POST /batches/{batch_id}/apply-to-productMake parts of the batch the product’s defaults (parts: suppliers, recipes, marketing, packaging)
GET, POST /batches/{batch_id}/lab-values, PATCH, DELETE /lab-values/{metric_id}Lab values (name, value, unit, limit, status optimal, compliant, warning, info, institute, date)
GET /batches/{batch_id}/ingredientsProducer and origin of each traced ingredient, as booked in Produktion. Read only: confirming them stays a step in Hive Engine.
GET /batches/{batch_id}/qr?format=png or svgThe batch’s QR code. Without a GTIN: 409 with gtin_missing.
GET /batches/{batch_id}/label?format=pdf or svgThe label from the product’s label template. Without a template: 409 with label_template_missing.
GET /batches/deleted?since=…Deletion list
Terminal window
curl -X POST "https://<your-instance>/api/v1/traceability/batches/…/lab-values" \
-H "Authorization: Bearer hek_…" \
-H "Content-Type: application/json" \
-d '{"name": "Moisture", "value": "3.1", "unit": "%", "status": "compliant",
"test_institute": "Lab Example", "test_date": "2026-11-05"}'

Suppliers and certifications

EndpointPurpose
GET /suppliers and /{supplier_id}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}/chainThe supplier and its parents
GET /certifications, POST, PATCH, DELETE /certifications/{certification_id}Certifications of a product, supplier or the brand (owner_type product, 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.

Recipes, packaging, marketing content

EndpointPurpose
/recipes, /recipes/{recipe_id}/ingredients, /recipe-ingredients/{ingredient_id}Consumer recipes with steps, ingredients and products
/packagingPackaging with material, recycling code (e.g. GL-70, PAP-20) and disposal instructions
/marketing-contentMarketing Content with story, text and products

Each with GET (list and single), POST, PATCH, DELETE and a deletion list …/deleted?since=….

Translations

EndpointPurpose
GET /translations?entity_type=…&entity_id=…&language_code=enThe translated fields of one entry in one language
PUT /translationsTranslate 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

CodeMeaning
batch_publishedThe batch is published and frozen
gtin_invalid, gtin_taken, gtin_missingGTIN with a wrong check digit, already used, or missing for the QR code
label_template_missing, label_not_renderableNo label template, or the label can’t be made from the batch’s data
not_foundNot found, also for entries of another business

What’s next