Documentation

JSON API

The fmcgProducts API is a JSON web API on each customer instance. Other systems can create and update product master data, check GS1 status, and fetch the same validated data that you send to GS1 and EPD.

GET /api

A GET to the API root is public. It returns the product name, build version, and links to the live OpenAPI description:

{
  "status": 200,
  "product": "fmcgProducts",
  "version": "…",
  "documentation": "/api/openapi",
  "documentationAsJson": "/api/openapi.json",
  "documentationUi": "/swagger/index.html"
}

If you call it while logged in, the response also includes username.

Base URL

Replace {instance} with the company host:

https://{instance}.fmcgproducts.dk/api

Each instance has its own products, views, export profiles, API keys and templates.

What you can do

  • Update a product, or several products, as JSON. Send only the fields that changed (a delta) or a fuller set of fields. The same request can create a product when the GTIN and target market do not exist yet.
  • Import an .xls or .xlsx file with POST /api/import. The original file name selects the import profile.
  • Validate a draft in memory (test: true or POST /api/validate) without saving.
  • Check status after an update: accepted, in progress, rejected, and GS1 validation errors.
  • Fetch selected fields, a view, Excel, PDF or HTML product sheets, and the company logo.
  • Send a hierarchy to GS1, or withdraw it, when the data is ready.

Field names in JSON are fmcgProducts field ids such as D8165 (GTIN) and D8255 (target market country code, ISO 3166-1 numeric). Identifiers and fields explains the keys. Authentication explains X-Api-Key.

Import an Excel file

POST /api/import?filename=products.xlsx

The body is the workbook itself. Content-Type is application/vnd.openxmlformats-officedocument.spreadsheetml.sheet for .xlsx, or application/vnd.ms-excel for .xls. application/octet-stream is also accepted. The filename query parameter is the original file name, including the extension, and it selects the import profile. When no profile matches that name, the upload page’s default Excel profile is used. Only .xls and .xlsx are accepted.

The call runs in the HTTP request, the same way as the upload page. Image URL checks are paused, the products are imported and recalculated, and the workbook and the HTML log are stored on an Imported Files document.

curl -sS -X POST \
  -H "X-Api-Key: YOUR_KEY" \
  -H "Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" \
  --data-binary @products.xlsx \
  "https://{instance}.fmcgproducts.dk/api/import?filename=products.xlsx"

Requires an API key when keys are enabled. ?language= selects the language of translated messages: da, de, en, fi, no, or sv.

HTTP 200 means importStatus is SUCCESS or WARNINGS. HTTP 400 means the file was rejected or importStatus is FAILED. Rows that were accepted are still saved. The JSON body includes filename, profile, importStatus, rows, and records. Each record has id, action (CREATED, UPDATED, SKIPPED, or FAILED), comments, and items.

Live OpenAPI

Each instance serves the OpenAPI document as YAML at /api/openapi and as JSON at /api/openapi.json. The Swagger page is at /swagger/index.html. Use the document when you need the exact description for that build. These pages are the human-readable guide and stay in sync with the source; they do not list hidden or internal endpoints.

Typical flow

  1. Create or update units with POST /api.
  2. Read validationErrors and fmcgProductsStatus (or call GET /api/status/{productId}).
  3. When the hierarchy is valid, POST /api/sendToGS1 or use POST /api/update-and-sendToGS1.
  4. Website, webshop or intranet fetch JSON, images and product sheets from the same source.

Need a key or an instance URL? Contact us or use the helpdesk.