Documentation
Update products
POST /api
The body is one JSON object or an array of objects. Content-Type: application/json. Requires an API key when keys are enabled.
Sending only the fields that changed is a delta: the existing unit is loaded and those items are saved. Sending a larger set of fields is a fuller update. There is no separate delta URL.
curl -sS -X POST \
-H "X-Api-Key: YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{"D8165":"01234567890123","D8255":"208","D8276":"BASE_UNIT_OR_EACH","D8258_1":"Test product","D8259_1":"en"}' \
"https://{instance}.fmcgproducts.dk/api"
Create vs update
The product id is D8165 + . + D8255. If that unit does not exist, the API creates it. D8276 is then required. If it exists, listed fields are updated.
Request options
These keys are not product fields. They are stripped before save:
| Key | Meaning |
|---|---|
test |
If true, validate and compute as usual but do not persist. The response includes "test": true. |
customRequestId |
Echoed on success and on error so you can correlate batches. |
deleteGrids |
JSON array of grid names. Each named grid is cleared (fields not also present in the body are set to null). |
deleteNotUsedPreparationStateFields |
If true, unused PREPARED or UNPREPARED nutrient fields are removed when the product only has one of those states. |
Validation without save
POST /api/validate
Same body as POST /api. The server sets test: true and never persists. Use this to validate one or more drafts together in memory for the duration of the request.
You can also send "test": true on POST /api; that is the same dry-run behaviour.
Numbers and decimals
Integer fields must be sent as JSON numbers without a fractional part. For measurement-style fields D8171, D8175, D8183, D8193, D8217 and D8280, a string such as "1.50" or "1,50" is converted to a number plus a matching …Decimals field.
Keyword and other coded values must be codes, not labels. Multi-value fields are JSON arrays of strings.
Response
A single-product success looks like a details payload: productId, unitType, fmcgProductsStatus, validationErrors, and related status fields. If save is rejected, result is Product not updated and the previous data is returned.
A batch request returns:
{
"status": 200,
"count": 2,
"products": [ { } ]
}
If any item has input errors, HTTP 400 is returned for the batch. Related products are recalculated after a successful batch.
Optimistic locking: if another user saved the unit first, the API returns the translated locking error.
Readonly and computed fields in the body are ignored. Unknown field names return field-level errors.
