Resolve a GTIN
Módulo Canon
GET/canon/element-gtins/resolvecanonElementGtins.resolve
Resolves a GTIN to its element through `xpms.resolve_gtin`. Many GTINs map to one element; one GTIN maps to at most one. An unknown GTIN returns a 422 `NO_ANSWER` refusal. A rule that refuses the request returns 422 with `refusal` and `reason`.
- Requiere la capacidad canon.taxonomy.read.
- Alcances de OAuth: canon.
- Estados de error: 400, 401, 422, 429. Los errores son detalles de problema RFC 9457.
Parámetros de ruta y de consulta
| Campo | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| gtin | string | Sí | GTIN to resolve.Restricciones: pattern ^[0-9]{8,14}$ |
Respuesta 200: ElementResolution
| Campo | Tipo | Obligatorio | Descripción |
|---|---|---|---|
| element_id | ItemId | Sí | Catalog item identifier `{URID}-{ORG}-{SEQ}` (Section 3.6).Restricciones: pattern ^[0-9]000\.[0-9]{2}\.[0-9]{2}-[A-Z0-9]+-[0-9]+$ |
| urid | Urid | Sí | Category URID `DDDD.DD.DD` from `xpms.dim_category` (Section 3.3). There is no fourth segment.Restricciones: pattern ^[0-9]000\.[0-9]{2}\.[0-9]{2}$ |
| item | string | Sí | Element name.Restricciones: length 1 to 200 |
| match | string | Sí | How the element matched.Restricciones: pattern ^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$ |
{
"element_id": "4000.01.01-XPMS-001",
"urid": "4000.01.01",
"item": "Ground Stage Deck",
"match": "gtin"
}Ejemplos de código
curl -X GET "$XOS_BASE_URL/canon/element-gtins/resolve" \
-H "Authorization: Bearer $XOS_API_KEY"const { data } = await xos.canonElementGtins.resolve();response = xos.canon_element_gtins.resolve()xos canon-element-gtins resolve