Skip to main content
POST
Create routing rule

Authorizations

X-API-Key
string
header
required

Path Parameters

organization_id
string<shortuuid>
required

UUID of the organization that owns the rules.

Required string length: 22
Pattern: ^[23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{22}$

Body

application/json

Payload to create a routing rule.

gtin
string
required

The GTIN of one of the organization's products.

Maximum string length: 14
Pattern: ^[^\x00]{0,14}$
name
string
required

Operator-facing label (max 100 characters).

Maximum string length: 100
Pattern: ^[^\x00]{0,100}$
predicate_kind
enum<string>
required

What the rule matches: DATE_WINDOW (the scanned use-by or best-before date falls in the window), LOT_LIST (the scanned lot, AI 10, is in match_values) or SERIAL_SET (the scanned serial, AI 21, is in match_values).

Available options:
DATE_WINDOW,
LOT_LIST,
SERIAL_SET
priority
integer
default:100

Lower priorities are evaluated first and the first matching rule wins (0 to 32767, default 100).

Required range: 0 <= x <= 32767
window_start
string<date> | null

DATE_WINDOW: inclusive start (YYYY-MM-DD); null for no lower bound.

window_end
string<date> | null

DATE_WINDOW: inclusive end (YYYY-MM-DD); null for no upper bound.

match_values
string[]

LOT_LIST or SERIAL_SET: the lot or serial values to match, one entry each.

Pattern: ^[^\x00]{0,}$
param_overrides
Param Overrides · object

Query parameters to set on the redirect when the rule matches: a flat map of string keys to string values. Values may use tokens such as {gtin} and {lot}.

path_override
string
default:""

A same-host absolute path to swap into the destination when the rule matches (for example /spring-sale); empty keeps the destination's path. Must start with a single '/'.

Maximum string length: 500
Pattern: ^[^\x00]{0,500}$

Response

Created

A routing rule as read from the API.

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}$
gtin
string
required

The GTIN of the product this rule decorates.

name
string
required

Operator-facing label (max 100 characters).

priority
integer
required

Lower priorities are evaluated first and the first matching rule wins (0 to 32767, default 100).

predicate_kind
enum<string>
required

What the rule matches: DATE_WINDOW (the scanned use-by or best-before date falls in the window), LOT_LIST (the scanned lot, AI 10, is in match_values) or SERIAL_SET (the scanned serial, AI 21, is in match_values).

Available options:
DATE_WINDOW,
LOT_LIST,
SERIAL_SET
match_values
string[]
required

LOT_LIST or SERIAL_SET: the lot or serial values to match, one entry each.

param_overrides
Param Overrides · object
required

Query parameters to set on the redirect when the rule matches: a flat map of string keys to string values. Values may use tokens such as {gtin} and {lot}.

path_override
string
required

A same-host absolute path to swap into the destination when the rule matches (for example /spring-sale); empty keeps the destination's path. Must start with a single '/'.

is_active
boolean
required

Whether the rule is switched on. A deactivated rule is never evaluated.

effective
boolean
required

Whether the rule can change a scan: true only when it is active and its product has the Enhanced ROUTING_RULES capability. A rule on a product without it is saved but inert; read this back after a write.

organization_id
string<shortuuid>
required

UUID of the organization that owns the product.

Required string length: 22
Pattern: ^[23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz]{22}$
created
string<date-time>
required

ISO-8601 creation timestamp.

modified
string<date-time>
required

ISO-8601 last-modified timestamp.

window_start
string<date> | null

DATE_WINDOW: inclusive start (YYYY-MM-DD); null for no lower bound.

window_end
string<date> | null

DATE_WINDOW: inclusive end (YYYY-MM-DD); null for no upper bound.