Documentation

Send to GS1

These POST endpoints require an API key when keys are enabled. They operate on the simplest product hierarchy for the GTIN and target market. For target market Norway (578) the same calls send to EPD instead of GS1.

Send

POST /api/sendToGS1

The body is one JSON object, or an array of the same objects. D8165 and D8255 are required on each unit. D8255 is the ISO 3166-1 numeric target market code. Identifiers and fields has the rules, including leading zeros. If dataRecipient is present on a unit, that GLN is used instead of the data recipients stored on the top product. It applies only to that unit.

{
  "D8165": "01234567890123",
  "D8255": "208",
  "dataRecipient": "1234567890123"
}

A single object returns productId and result. HTTP 200 means that hierarchy was sent. HTTP 400 means the product was not found, there is no active hierarchy, the recipient is not valid, the body is invalid, or the transmission failed. sendStatusList may be present when the send did not go through.

An array sends each unit in order and returns status, count, and products. Each item has its own status of 200 or 400, plus the same fields as a single send. The HTTP status is 200 when every item was sent, and 400 when any item failed. An array of one unit uses this batch response.

[
  { "D8165": "01234567890123", "D8255": "208" },
  { "D8165": "01234567890130", "D8255": "208", "dataRecipient": "1234567890123" }
]

A unit already included in a hierarchy sent earlier in that request, with the same dataRecipient, is not sent again. That item has includedIn set to the product id that covered it. Omitting dataRecipient uses the recipients stored on the top product, and that does not match an explicit GLN: the unit is sent again. An item that is not an object, or that has no GTIN or target market, is a failed item. Field messages are in errors on that item. The other units are still sent.

Update and send

POST /api/update-and-sendToGS1

Same product JSON as Update products, single object or array. Optional dataRecipient is used only for the send step; it is not stored.

  1. The product is updated (or created).
  2. If the hierarchy is GS1-validated, it is sent to GS1.
  3. A failed send does not undo a successful update.

HTTP status:

Code Meaning
200 Updated. sendToGS1.status is SENT, or SKIPPED when not GS1-validated or in test mode
202 Updated, but send to GS1 did not succeed
400 Input errors; nothing reliable to send

Dry-run: "test": true updates nothing and does not send.

Withdraw

POST /api/sendWithdrawalToGS1

{
  "D8165": "01234567890123",
  "D8255": "208"
}

Withdraws that hierarchy completely from GS1 (or EPD for Norway). The response includes productId and result. HTTP 400 if the product is missing, the body is invalid, or the withdrawal failed (sendStatusList may be included).