Docs

Docs / Data Feed / Restrictions

For Data Feed stores
Endpoint · Preview a restriction

POST/restrictions/preview

See what a new restriction, or a change to one, would hide before you save it. Saves nothing.

Needs Restrictions: Read and writeBase URL https://backend.fflmonkey.com/api/v1Counts 1 toward 120 a minute

Fields

Needs Restrictions: Read and write, like the save it stands in for. It saves nothing: no restriction, no price and no change are written or announced. Send one of two bodies:

  • A new restriction: the body you would send to POST /restrictions, checked as a create is. An only-show with no condition, or a from_price above the to_price, is refused, as a save refuses it.
  • A change to a restriction: restriction_id and the fields you would send to PATCH /restrictions/{id}, laid over it as the PATCH would lay them.
FieldTypeRule
restriction_idoptionalintegerA stored restriction to preview a change to. With it, every other field is optional and is laid over the restriction as a PATCH would lay it. Without it, the body is a new restriction's.
nameoptionalstringUp to 120 characters. Required for a new restriction.
restriction_typeoptionalstringexclude hides what it matches; only_show hides what no switched-on only-show matches. Required for a new restriction.
distributorsoptionallist of stringsDistributor slugs, as a product's sourced_from names them: it applies to those distributors' offers, never to your own stock. Empty or left out: any.
categoriesoptionallist of stringsCategory slugs from GET /categories; each takes in the categories below it. Empty or left out: any.
manufacturersoptionallist of stringsBrand slugs from GET /manufacturers. Empty or left out: any.
product_classesoptionallist of stringsProduct class slugs from GET /product-classes. Empty or left out: any.
upcsoptionallist of stringsUPCs, 6 to 14 digits each. A code that can never match (a spreadsheet's scientific notation, a leading apostrophe) is refused. Empty or left out: any.
skusoptionallist of stringsSKUs 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 or left out: any.
min_stockoptionalinteger or null0 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_priceoptionalstring, number or nullThe lowest distributor cost it matches, 0 to 9999999.99, at most two decimals, or null for no lower bound.
to_priceoptionalstring, number or nullThe highest distributor cost it matches, on the same terms, and never below from_price, or null for no upper bound.
disabledoptionalbooleantrue keeps the restriction and hides nothing.
confirm_tokenoptionalstringAccepted, and changes nothing.
acknowledge_zero_matchoptionalbooleanAccepted, and changes nothing: a preview is never refused for matching nothing, it says so in zero_match.

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.

The two confirmations a save asks for are not asked here: the preview is how you find out what they are about. 10 previews a minute per store, pricing rules and restrictions together, whichever key asks.

What it answers

The shape of a pricing rule preview, without this_rule: there applied_rule_id is the pricing rule that prices the product. A product it would hide has visible false and hidden_reason restricted after. For an only-show, what it hides is everything it does not name, so catalog_count against scope_count is the number to read, and the samples are drawn from the whole catalog as well.

Returns

  • 200What saving it would do, in data. Nothing was saved.
  • 404restriction_not_found: your store has no restriction with that restriction_id.
  • 422validation_failed: a field broke a rule, as it would on the save.
  • 429rate_limited: more than 10 previews in a minute for this store. Wait for Retry-After seconds.

This endpoint can also answer 401 invalid_api_key, 403 license_not_active, 403 product_not_included, 403 insufficient_scope and 429 rate_limited.

Example

FFL Monkey Data Feed API, version 1. Questions: Support in your FFL Monkey account, or [email protected].