Fields
The restriction's id in the address, and in the body only the fields to change, at least one. Needs Restrictions: Read and write.
| Field | Type | Rule |
|---|---|---|
| nameoptional | string | Up to 120 characters. |
| restriction_typeoptional | string | exclude hides what it matches; only_show hides what no switched-on only-show matches. |
| distributorsoptional | list of strings | Distributor slugs, as a product's sourced_from names them: it applies to those distributors' offers, never to your own stock. Empty: any. Sent, it replaces what the restriction holds; left out, it keeps it. |
| categoriesoptional | list of strings | Category slugs from GET /categories; each takes in the categories below it. Empty: any. Sent, it replaces what the restriction holds; left out, it keeps it. |
| manufacturersoptional | list of strings | Brand slugs from GET /manufacturers. Empty: any. Sent, it replaces what the restriction holds; left out, it keeps it. |
| product_classesoptional | list of strings | Product class slugs from GET /product-classes. Empty: any. Sent, it replaces what the restriction holds; left out, it keeps it. |
| upcsoptional | list of strings | UPCs, 6 to 14 digits each. A code that can never match (a spreadsheet's scientific notation, a leading apostrophe) is refused. Empty: any. Sent, it replaces what the restriction holds; left out, it keeps it. |
| skusoptional | list of strings | SKUs of up to 64 characters: a distributor's, matched against its offer, or your own in-house one. A code that can never match is refused. Empty: any. Sent, it replaces what the restriction holds; left out, it keeps it. |
| min_stockoptional | integer or null | 0 to 1000000. On an exclude, it matches an offer with fewer than this in stock; on an only-show, one with at least this many. Null: any. |
| from_priceoptional | string, number or null | The lowest distributor cost it matches, 0 to 9999999.99, at most two decimals, or null for no lower bound. |
| to_priceoptional | string, number or null | The highest distributor cost it matches, on the same terms, and never below from_price, or null for no upper bound. |
| disabledoptional | boolean | true keeps the restriction and hides nothing. |
| confirm_tokenoptional | string | After a 422 catalogue_wipe_confirmation_required: the confirm_token from that answer, to save a restriction that empties your store anyway. |
| acknowledge_zero_matchoptional | boolean | Send true to save a restriction that matches no product in the catalog, after a 422 zero_match_confirmation_required. |
Each list takes at most 1,000 entries. Money with a third decimal is refused, never rounded. Name distributors in distributors: distributor_slug and distributor_slugs are refused.
- Everything you do not send is kept: its switch, its distributors and every condition you leave out. A condition you send replaces the old one, and
[]means any. There is no PUT, for the reason a pricing rule has none. - A condition that reads
"(deleted)"cannot be sent back. Leave it out to keep what the restriction holds, or send the slugs you mean. - The checks a create meets are made on the restriction as it would be saved. Emptying the one condition of an only-show is refused, and switching on an
excludewith no condition asks for itsconfirm_token. A change to a restriction that already matches nothing is asked about again. - What follows: your store is worked out again, and the restriction is announced as
restriction.updated.
Returns
- 200The restriction as it is now, in
data. - 404restriction_not_found: your store has no restriction with that id.
- 422validation_failed: a field broke a rule, or the body has none of the restriction's fields (named
body). - 422catalogue_wipe_confirmation_required or zero_match_confirmation_required: as on a create. Nothing was changed.
This endpoint can also answer 401 invalid_api_key, 403 license_not_active, 403 product_not_included, 403 insufficient_scope and 429 rate_limited.