Skip to content

Update Cart Rule

Updates an existing cart rule — the Edit Rule action on the admin Marketing → Promotions → Cart Rules screen.

TIP

New here? Read the Cart Rules overview for what a cart rule does and how its fields behave.

Endpoint

EndpointMethod
/api/admin/marketing/cart-rules/{id}PUT

Details

  • Requires an admin Bearer token and the marketing.promotions.cart_rules.edit permission.
  • The update is a partial merge — send only the fields you want to change; omitted fields keep their existing values.
  • When channels or customer_groups is supplied, that list replaces the rule's current channels / customer groups. Omit them to leave the existing sets untouched.
  • Returns the full updated rule payload.

Request body

FieldTypeRequiredNotes
namestringnoRule name
descriptionstringnoFree-text description
channelsint[]noReplaces the rule's channels when supplied
customer_groupsint[]noReplaces the rule's customer groups when supplied
coupon_typeintno0 auto-apply when conditions match / 1 specific code
use_auto_generationintno1 to auto-generate coupon codes
coupon_codestringnoRequired + unique when coupon_type is 1 and use_auto_generation is 0
action_typestringnoby_percent, by_fixed, cart_fixed, buy_x_get_y
discount_amountnumbernoDiscount value; capped at 100 when action_type is by_percent
discount_quantityintnoQuantity for buy_x_get_y
discount_stepstringnoStep for buy_x_get_y
apply_to_shippingintno1 applies the discount to shipping
free_shippingintno1 grants free shipping
condition_typeintno1 match all conditions / 0 match any
conditionsarraynoCart / product filters
end_other_rulesintno1 stops lower-priority rules from also applying
uses_attribute_conditionsintno1 when conditions use product attributes
usage_per_customerintnoPer-customer usage cap (0 = unlimited)
uses_per_couponintnoPer-coupon usage cap (0 = unlimited)
sort_orderintnoPriority — lower runs first
statusintno0 inactive / 1 active
starts_fromstringnoStart date (YYYY-MM-DD) or null
ends_tillstringnoEnd date (YYYY-MM-DD) or null; must be >= starts_from

Released under the MIT License.