Skip to main content
POST
Add product trait

Authorizations

X-API-Key
string
header
required

Path Parameters

gtin
string<gtin>
required

GTIN-8, GTIN-12, GTIN-13, or GTIN-14 digits (no separators) with a valid GS1 check digit. Normalized to GTIN-14 for lookup; an invalid GTIN returns 422.

Required string length: 8 - 14

Body

application/json

Payload for POST /products/{gtin}/traits.

category
enum<string>
required

ALLERGEN or DIETARY.

Available options:
ALLERGEN,
DIETARY
term
string
required

The vocabulary term, upper case. ALLERGEN takes the GS1 allergen vocabulary (for example MILK, EGGS, PEANUTS, SESAME). DIETARY takes VEGAN, VEGETARIAN, GLUTEN_FREE, DAIRY_FREE, KETO_FRIENDLY or PALEO. A term outside the category's vocabulary returns 422 and the response lists every accepted term.

Maximum string length: 40
Pattern: ^[A-Z_]+$

Response

Created

An allergen or dietary trait declared on a product.

id
string<shortuuid>
required

URL-safe 22-character shortuuid encoding of the row's UUID primary key. Stable across the row's lifetime; suitable for sharing in URLs, log lines, and external SDK clients. Accepted on input as either the shortuuid form or the canonical UUID form (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

Required string length: 22
Pattern: ^[23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{22}$
category
enum<string>
required

ALLERGEN or DIETARY.

Available options:
ALLERGEN,
DIETARY
name
string
required

The trait's display name, e.g. 'Milk' or 'Gluten-Free'.

created
string<date-time>
required

Server-side ISO 8601 timestamp of creation (UTC).

modified
string<date-time>
required

Server-side ISO 8601 timestamp of last modification (UTC).