Maintaining your product catalog through the API
After reading this article you can create, update and sync your complete product catalog — products, prices, categories, recipes, work steps, packages, images and supplier ordering settings — from your own system through the API instead of importing spreadsheets.
If your product catalog lives in another system (merchandise management, ERP, recipe software), the /api/v1/products endpoints keep it in sync with Univents. Your system sends the products, Univents creates or updates them — with the same rules as the inventory: gross/net price, standard VAT rate, purchase price per packaging, inherited allergens and automatic package prices.
Every field, its type and its allowed values are listed in the API reference at https://univents.app/api/v1/docs (section products, schema Product).
Key and permission
Create a key under Integrations → Developer → API keys with Read products & categories and Write products, categories & recipes. Writing does not include reading — pick both if your system also queries. The setup is described in the article on API keys.
Your own identifier: external_id
Send the number from your system as external_id. It is unique within your workspace; a second product with the same identifier is rejected. That way you never need to store our internal IDs. When a product is deleted, its identifier is free again.
Creating a product
curl -X POST https://univents.app/api/v1/products \
-H "Authorization: Bearer rv_live_…" \
-H "Content-Type: application/json" \
-d '{"name":"Farmhouse bread","external_id":"ERP-1001","sku":"BR-1","price_gross":4.28,"tax_rate":7,"alt_unit_name":"loaf","category_name":"Bread","allergens":["Glutenhaltiges Getreide"]}'
Without tax_rate your workspace standard rate applies. Set the category with category_id or category_name — an unknown name creates the category.
Allergens: free text, as in the inventory
allergens is free text — exactly like the allergen field in the inventory. Univents prints the text as you send it on quotes, menu cards and labels. So send what your guests should read:
- one entry per allergen, for example
["Glutenhaltiges Getreide", "Eier", "Milch (inkl. Laktose)", "Schalenfrüchte"]— the way the quick pick in the inventory enters them (German names for a German-speaking workspace), - a comma inside an entry is fine (
"Schalenfrüchte (Haselnuss, Mandel)"), - at most 60 characters per entry and 40 entries.
For the allergen symbols Univents recognises the 14 EU allergens by their name (also by words such as “Weizen” or “Haselnüsse”), by the letters A–R and by codes such as gluten or milk. A code is printed exactly as sent, though — so prefer the name. Entries like “ohne Ei” or “glutenfrei” never count as an allergen.
Prices: one side leads
Send either price_net or price_gross. The side you send leads (price_basis) and Univents derives the other one with the VAT rate. Both together are rejected, so no side is ever silently lost. If you later change only the VAT rate, the leading side stays and the other is recalculated.
Syncing many products at once
POST /api/v1/products/batch takes up to 500 products per call:
curl -X POST https://univents.app/api/v1/products/batch \
-H "Authorization: Bearer rv_live_…" \
-H "Content-Type: application/json" \
-d '{"rows":[{"external_id":"ERP-1001","price_gross":4.48},{"external_id":"ERP-1002","sku":"FLOUR-405","name":"Wheat flour 405","price_net":0.89,"alt_unit_name":"kg"}]}'
This is how Univents finds the matching product for each row:
id, if you send it,- otherwise
external_id— unknown means: create, - otherwise
sku, but only if exactly one product has that article number, - otherwise the product is created (
nameis required then).
A row without id, external_id and sku is rejected, so a retry never creates duplicates. On the first sync with external_id and sku, Univents links your identifier to the existing product with that article number.
What gets overwritten: fields you send overwrite the stored value. Fields you leave out stay unchanged. null clears a field.
Description: description is plain text. When you send it (on create, update or in a sync), it replaces the description formatted in the inventory: the formatting is dropped, and the inventory, booking pages and documents show exactly your text. Each line break (\n) becomes its own paragraph in the inventory.
Don’t overwrite what changed in the meantime: a row can carry expected_updated_at — the updated_at you last read. If someone changed the product since (in the inventory, say), only this row fails with the error stale-version; the other rows run normally. This applies with "dry_run": true as well. A row with expected_updated_at that matches no (longer existing) product creates nothing.
The response lists created, updated or error for each row, with the reason and field names. A faulty row does not stop the others. With "dry_run": true you check a sync without writing anything. If two rows point to the same product (say once by identifier, once by article number), only the first applies. A batch counts as one request towards the limit of 120 requests per minute; on top of that, at most 6 batch calls per minute and key are possible (3,000 products). Article numbers and identifiers may contain any character, including inch marks such as Monitor 24", HDMI.
Recipes and packages
PUT /api/v1/products/{id}/components replaces the complete ingredient or content list of a product:
curl -X PUT https://univents.app/api/v1/products/<id>/components \
-H "Authorization: Bearer rv_live_…" \
-H "Content-Type: application/json" \
-d '{"components":[{"child_external_id":"ERP-2001","quantity_per_parent":0.5},{"child_sku":"SALT-1","content_quantity":10}]}'
Each row references a product of your workspace with exactly one of child_product_id, child_external_id or child_sku. The amount is in the ingredient’s unit (quantity_per_parent) or in its content per unit (content_quantity, e.g. 200 ml from a 1 l bottle). The list is replaced completely or not at all; if an ingredient already contains this product, the call is rejected. Univents recalculates automatic prices, purchase prices and allergens afterwards. If a plain product (type physical_product, neither package, recipe nor rental) gets at least one component this way, it automatically becomes a package (is_bundle) — just like in the inventory when you add the first component. The response reports this with promoted_to_bundle. Recipes, packages, rental items and services keep their type, and an empty list does not change the type. To make the product a recipe, set is_kitchen_produced on the product. A product the API created without product_type and without components is a service and stays one here — send "product_type":"physical_product" with it if it should become a package.
The easiest way to create a package is one call: send the components right when you create the product (POST /api/v1/products or a batch row), in the same format as above:
curl -X POST https://univents.app/api/v1/products \
-H "Authorization: Bearer rv_live_…" \
-H "Content-Type: application/json" \
-d '{"name":"BBQ package","external_id":"ERP-3001","components":[{"child_external_id":"ERP-2001","quantity_per_parent":2}]}'
If product_type is missing and at least one component is included, Univents creates the product as a physical product and it becomes a package. If you send product_type, exactly that type stays — service included. The components are checked before anything is saved; if they cannot be saved, the product is not created either. In a batch, components may point to products created by an earlier row of the same call (not a later one), and "dry_run": true checks the components too. If a batch row brings components for a product that already exists, it replaces its list like the call above, without changing the type.
Production category and yield
production_category_idassigns a product to a production category (kitchen, pastry, prep …) — the grouping of the kitchen monitor and the production list.GET /api/v1/production-categoriesreturns the ids. If you send the id of a sub-category, main and sub-category are both set (the main category is itsparent_id).nullremoves the assignment. An id of another workspace or a catalog category is rejected withmissing-reference. You create the production categories themselves in the inventory.prep_loss_pct(trimming loss) andcooking_loss_pct(cooking loss) in percent, from 0 to below 100, rounded to two decimals — the same fields as in the Recipe section or the master data. 0 means no loss.
curl -X PATCH https://univents.app/api/v1/products/<id> \
-H "Authorization: Bearer rv_live_…" \
-H "Content-Type: application/json" \
-d '{"production_category_id":"<id from /production-categories>","prep_loss_pct":15,"cooking_loss_pct":20}'
Work steps with target times
With the Production module you also maintain the work steps of a recipe: GET /api/v1/products/{id}/recipe-steps reads them, PUT replaces the complete list — like the ingredients.
curl -X PUT https://univents.app/api/v1/products/<id>/recipe-steps \
-H "Authorization: Bearer rv_live_…" \
-H "Content-Type: application/json" \
-d '{"steps":[{"text":"melt butter","target_minutes":10,"components":[{"child_external_id":"ERP-2001"}]},{"text":"bake at 170 °C","target_minutes":25,"target_per_quantity":10}]}'
- Steps you no longer send are deleted. A step with
id(from theGET) is kept, one withoutidis new. componentssays which ingredients are added at this step — bycomponent_id,child_product_id,child_external_idorchild_sku. Each ingredient belongs to at most one step; ingredients you list nowhere have no step afterwards.target_minutesis the target time in minutes. Withtarget_per_quantityit applies per that quantity in the recipe unit, otherwise fixed per order. If you leave outtarget_minuteson an existing step, it keeps its target time;nullremoves it.- With
expected_versionfrom theGETthe call is rejected (stale-version) if someone changed the steps in the meantime. - Target times with more than two decimals caused by rounding noise (such as
0.30000000000000004) are rounded to two decimals. - At most 30 steps of 1–200 characters each. Without the Production module both calls answer
module-required; if the product is not a recipe,not-editable.
Main image from an image address
PUT /api/v1/products/{id}/image with {"url":"https://…/image.jpg"} takes over an image as the product’s main image. Univents downloads the image once and stores its own copy; your address is not used afterwards.
- Only public
httpsaddresses — every redirect has to behttpstoo —, at most 3 redirects and 15 seconds; addresses in internal networks are refused. - JPEG, PNG, WebP, GIF or AVIF up to 5 MB. Univents checks the file content, not just what the server declares.
- If the image cannot be taken over, the API answers
image-import-failedand changes nothing. {"url": null}removes the main image.- At most 20 attempts per minute and key — a failed attempt counts too.
Suppliers: ordering settings and business relationship
You maintain a supplier’s ordering settings through the company: GET or PATCH /api/v1/companies/{id}/supplier-settings. The key needs the contacts permission (read or write).
curl -X PATCH https://univents.app/api/v1/companies/<id>/supplier-settings \
-H "Authorization: Bearer rv_live_…" \
-H "Content-Type: application/json" \
-d '{"is_supplier":true,"wholesaler":"metro","customer_number":"4711-02","order_cutoff_time":"10:00","order_lead_days":1,"delivery_weekdays":[2,4]}'
is_suppliersets or removes the business relationship supplier — customer and partner stay as they are.customer_number(customer number at the supplier),order_cutoff_time(order cut-offHH:MM),order_lead_days(lead time 0–14 days),delivery_weekdays(delivery days, 1 = Monday … 7 = Sunday) andwholesaler(metro,transgourmet,chefs_culinarorother) — the same details as in the ordering settings.- Fields you leave out stay,
nullclears a field. Customer numbers per cost center are still maintained in the app.
Categories and locations
/api/v1/product-categoriescreates, renames and deletes catalog categories. Products of a deleted category move to the fallback category; the fallback category itself cannot be deleted.PUT /api/v1/products/{id}/locationssets at which locations a product is offered (available) or booked automatically (required).
Fetching changes
GET /api/v1/products?updated_since=… returns every product changed since a point in time, page by page with cursor. You can also filter by external_id, sku, category_id or production_category_id. Deleted products come with include_deleted=true.
What the API does not cover (yet)
Additional images (besides the main image), variants, price groups, prices from a future date, additional suppliers per product, ticket quotas, the production categories themselves and customer numbers per cost center are still maintained in the app. Fields Univents calculates itself (such as inherited allergens) are readable but not writable — sending them returns an error naming the field.