Skip to main content
POST
/
products
/
api
/
v1
/
digital-link
/
parse
Parse a GS1 Digital Link URL into structured AIs
curl --request POST \
  --url https://www.closient.com/products/api/v1/digital-link/parse \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "url": "<string>"
}
'
{
  "is_valid": true,
  "url": "<string>",
  "gtin": "00614141123452",
  "lot": "<string>",
  "expiry": "261231",
  "serial": "<string>",
  "raw_ais": {}
}

Documentation Index

Fetch the complete documentation index at: https://docs.closient.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

X-API-Key
string
header
required

Body

application/json

Request body for the parse endpoint.

url
string
required

The candidate URL to parse. Should be a GS1 Digital Link URI of the form https://{host}/01/{gtin}[/10/{lot}][/21/{serial}][?17={expiry}].

Required string length: 1 - 4096
Example:

"https://gtin1.com/01/00614141123452/10/LOT1/21/SN1?17=261231"

Response

200 - application/json

OK

Response body for the parse endpoint.

is_valid is True when the input is a recognisable GS1 Digital Link (carries a /01/{gtin} segment with a valid Mod-10 GTIN) and False otherwise. When False, all the structured fields are null and raw_ais is empty — the caller should fall back to treating the URL as an arbitrary link rather than a GS1-aware payload.

is_valid
boolean
required

True when the URL parses as a conformant GS1 Digital Link with a valid GTIN.

url
string
required

The input URL, echoed back unchanged.

gtin
string | null

The normalized GTIN-14 if a /01/ segment is present and Mod-10-valid; otherwise null.

Example:

"00614141123452"

lot
string | null

GS1 AI 10 (lot/batch) if present in the path.

expiry
string | null

GS1 AI 17 (expiry, YYMMDD) if present in the path. Note: GS1 spec allows AI 17 on the query string too — this v1 endpoint reads path-only per the underlying parser.

Example:

"261231"

serial
string | null

GS1 AI 21 (serial) if present in the path.

raw_ais
Raw Ais · object

Every AI/value pair found in the path, including any non-first-class AIs not surfaced as named fields above.