Rules
Merchandising rules.
5 endpoints.
GET
/v1/rulesList merchandising rules
Needs a key or a dashboard session
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
cursor | query | string | null | no | max length 200 |
limit | query | integer | no | default 100 · min 1 · max 200 |
Responses
- 200Successful Response
Page_RuleOut_
POST
/v1/rulesCreate a pin / boost / bury / hide / redirect / banner rule
Needs a key or a dashboard session
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
Idempotency-Key | header | string | null | no | Unique per logical write (8-255 chars). Retries with the same key are safe. · pattern ^[A-Za-z0-9_\-:.]{8,255}$ |
Request body application/json RuleIn
| Name | Type | Required | Description |
|---|---|---|---|
name | string | yes | max length 200 |
type | "pin" | "boost" | "bury" | "hide" | "redirect" | "banner" | yes | |
conditions | RuleConditions | yes | |
actions | RuleActions | yes | |
priority | integer | no | default 0 · min -1000 · max 1000 |
enabled | boolean | no | default true |
starts_at | string (date-time) | null | no | |
ends_at | string (date-time) | null | no |
Responses
- 201Successful Response
RuleOut
GET
/v1/rules/{rule_id}Rules Get
Needs a key or a dashboard session
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
rule_id | path | string | yes |
Responses
- 200Successful Response
RuleOut
PUT
/v1/rules/{rule_id}Rules Update
Needs a key or a dashboard session
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
rule_id | path | string | yes |
Request body application/json RuleIn
| Name | Type | Required | Description |
|---|---|---|---|
name | string | yes | max length 200 |
type | "pin" | "boost" | "bury" | "hide" | "redirect" | "banner" | yes | |
conditions | RuleConditions | yes | |
actions | RuleActions | yes | |
priority | integer | no | default 0 · min -1000 · max 1000 |
enabled | boolean | no | default true |
starts_at | string (date-time) | null | no | |
ends_at | string (date-time) | null | no |
Responses
- 200Successful Response
RuleOut
DELETE
/v1/rules/{rule_id}Rules Delete
Needs a key or a dashboard session
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
rule_id | path | string | yes |
Responses
- 200Successful Response
Deleted
Data shapes on this page
Page_RuleOut_
| Name | Type | Required | Description |
|---|---|---|---|
data | RuleOut[] | yes | |
next_cursor | string | null | no | |
total | integer | null | no | Present when cheap to count. |
RuleOut
| Name | Type | Required | Description |
|---|---|---|---|
name | string | yes | max length 200 |
type | "pin" | "boost" | "bury" | "hide" | "redirect" | "banner" | yes | |
conditions | RuleConditions | yes | |
actions | RuleActions | yes | |
priority | integer | no | default 0 · min -1000 · max 1000 |
enabled | boolean | no | default true |
starts_at | string (date-time) | null | no | |
ends_at | string (date-time) | null | no | |
id | string | yes | |
created_at | string (date-time) | yes | |
updated_at | string (date-time) | yes |
RuleConditions
| Name | Type | Required | Description |
|---|---|---|---|
match | "exact" | "contains" | "any" | no | default "exact" |
terms | string[] | no | Normalized query terms. |
locales | string[] | no | |
categories | string[] | no | Apply only when filtered to these categories. |
RuleActions
| Name | Type | Required | Description |
|---|---|---|---|
product_ids | string[] | no | pin/boost/bury/hide targets. |
positions | integer[] | no | pin: target positions (1-based). |
filter | object | null | no | boost/bury by attribute, e.g. {brand: [HP]} |
factor | number | null | no | boost/bury strength.max 100 |
url | string | null | no | redirect target.max length 2048 |
banner | object | null | no | banner: {html|image_url, link_url, position} |
RuleIn
| Name | Type | Required | Description |
|---|---|---|---|
name | string | yes | max length 200 |
type | "pin" | "boost" | "bury" | "hide" | "redirect" | "banner" | yes | |
conditions | RuleConditions | yes | |
actions | RuleActions | yes | |
priority | integer | no | default 0 · min -1000 · max 1000 |
enabled | boolean | no | default true |
starts_at | string (date-time) | null | no | |
ends_at | string (date-time) | null | no |
Deleted
| Name | Type | Required | Description |
|---|---|---|---|
deleted | boolean | no | default true |
id | string | yes |