Aller au contenu principal

Identifier resolver

The resolver decodes any of the three accepted encodings into a single ResolvedIdentity shape, then looks up the matching Stockaj entity.

Decoding precedence

Resolved identity shape

{
"encoding": "GS1_DIGITAL_LINK",
"epc": "urn:epc:id:sgtin:9506000.134352.ABC123",
"gtin": "09506000134352",
"lot": null,
"serial": "ABC123",
"sscc": null,
"gln": null,
"expires_at": null,
"produced_at": null,
"original_payload": "https://id.stockaj.io/01/09506000134352/21/ABC123",
"resolved_target_type": "instance",
"resolved_target_id": 12345
}

API endpoint

POST /api/v1/identifier/resolve
Content-Type: application/json
Authorization: Bearer <token>

{ "payload": "https://id.stockaj.io/01/09506000134352/21/ABC123" }

Response: 200 OK with ResolvedIdentity body, or 422 if the payload is invalid, or 404 if the payload is well-formed but the target is not in the tenant's data.

Validation

  • GTIN, SSCC, GLN check digits validated (GS1 Mod-10).
  • Date AIs (11, 15, 17) parsed as YYMMDD and rejected if out of range.
  • Variable-length AIs (10, 21) capped at 20 chars per GS1 GenSpec.