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.
| Field | Type | Rule |
|---|---|---|
| nameoptional | string | Up to 120 characters. |
| markup_percentageoptional | string, number or null | Percent 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_fixedoptional | string, number or null | Dollars added after the percentage, -100000 to 100000, at most two decimals, or null for none. |
| apply_markup_price_tooptional | string | The base the markup is added to: cost, msrp, map_then_cost or map_then_msrp. |
| apply_only_when_has_mapoptional | boolean | true skips a product whose offer has no MAP above its cost. |
| apply_only_when_has_msrpoptional | boolean | true skips a product whose offer has no MSRP. |
| enforce_map_flooroptional | boolean or null | true never prices below MAP, false may, null follows your store's setting. |
| categoriesoptional | list of strings | Category 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. |
| manufacturersoptional | list of strings | Brand slugs from GET /manufacturers. Empty: any. Sent, it replaces what the rule holds; left out, the rule keeps it. |
| product_classesoptional | list of strings | Product class slugs from GET /product-classes. Empty: any. Sent, it replaces what the rule holds; left out, the rule keeps it. |
| distributorsoptional | list of strings | Distributor slugs, as a product's sourced_from names them. Empty: any. Sent, it replaces what the rule holds; left out, the rule keeps it. |
| upcsoptional | list of strings | UPCs, each up to 32 characters. Empty: any. Sent, it replaces what the rule holds; left out, the rule keeps it. |
| from_priceoptional | string, number or null | The lowest distributor cost the rule applies to, 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 applies to, on the same terms, or null for no upper bound. |
| disabledoptional | boolean | true keeps the rule and never applies it. |
| acknowledge_zero_matchoptional | boolean | 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
- 200The rule as it is now, in
data. - 404pricing_rule_not_found: your store has no rule with that id.
- 422validation_failed: a field broke a rule, or the body has none of the rule's fields (named
body). - 422zero_match_confirmation_required: the rule would match no product. 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.