Docs

Docs / Data Feed / Pricing rules

For Data Feed stores
Endpoint · Change a pricing rule

PATCH/pricing-rules/{id}

Change some fields of a rule and keep the rest, its place included. There is no PUT.

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

Fields

The rule's id in the address, and in the body only the fields to change, at least one. Needs Pricing rules: Read and write.

FieldTypeRule
nameoptionalstringUp to 120 characters.
markup_percentageoptionalstring, number or nullPercent added to the base, -100 to 999.99, at most two decimals, or null for none. Best sent as a string, such as "22.50".
markup_value_fixedoptionalstring, number or nullDollars added after the percentage, -100000 to 100000, at most two decimals, or null for none.
apply_markup_price_tooptionalstringThe base the markup is added to: cost, msrp, map_then_cost or map_then_msrp.
apply_only_when_has_mapoptionalbooleantrue skips a product whose offer has no MAP above its cost.
apply_only_when_has_msrpoptionalbooleantrue skips a product whose offer has no MSRP.
enforce_map_flooroptionalboolean or nulltrue never prices below MAP, false may, null follows your store's setting.
categoriesoptionallist of stringsCategory slugs from GET /categories; each takes in the categories below it. Empty: any. Sent, it replaces what the rule holds; left out, the rule keeps it.
manufacturersoptionallist of stringsBrand slugs from GET /manufacturers. Empty: any. Sent, it replaces what the rule holds; left out, the rule keeps it.
product_classesoptionallist of stringsProduct class slugs from GET /product-classes. Empty: any. Sent, it replaces what the rule holds; left out, the rule keeps it.
distributorsoptionallist of stringsDistributor slugs, as a product's sourced_from names them. Empty: any. Sent, it replaces what the rule holds; left out, the rule keeps it.
upcsoptionallist of stringsUPCs, each up to 32 characters. Empty: any. Sent, it replaces what the rule holds; left out, the rule keeps it.
from_priceoptionalstring, number or nullThe lowest distributor cost the rule applies to, 0 to 9999999.99, at most two decimals, or null for no lower bound.
to_priceoptionalstring, number or nullThe highest distributor cost it applies to, on the same terms, or null for no upper bound.
disabledoptionalbooleantrue keeps the rule and never applies it.
acknowledge_zero_matchoptionalboolean Send true to save a rule 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. A rule's place is not a field: sort_order is refused, and so is auto_place. Move a rule with POST /pricing-rules/reorder.

  • Everything you do not send is kept: the rule's place, its switch, its MAP floor setting and every condition you leave out. A condition you send replaces the old one, and [] means any.
  • There is no PUT, on purpose: a PUT resets what it is not sent, so one that left out a condition would widen the rule to every product, and one that left out its place would move it.
  • A condition that reads "(deleted)" cannot be sent back. Leave it out to keep what the rule holds, or send the slugs you mean.
  • Its place is not a field. Move it with POST /pricing-rules/reorder.
  • A change that leaves the rule matching nothing is held back as a create is, until you send "acknowledge_zero_match": true. It is asked again on each later change while the rule still matches nothing.
  • What follows: your prices are worked out again, and the rule is announced as pricing_rule.updated.

Returns

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].