Skip to content

Update Cart Rule

Updates an existing cart rule — the Edit 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.

Operation

OperationTypePurpose
updateAdminMarketingCartRuleMutationUpdate a cart rule

Details

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

Input fields

FieldTypeRequiredNotes
idIDYesThe rule's IRI
nameStringNoRule name
descriptionStringNoFree-text description
channelsArrayNoReplaces the rule's channels when supplied
customerGroupsArrayNoReplaces the rule's customer groups when supplied
couponTypeIntNo0 no coupon (auto-applies) / 1 specific coupon
useAutoGenerationIntNo1 to auto-generate coupon codes
couponCodeStringNoRequired + unique when couponType is 1 and useAutoGeneration is 0
actionTypeStringNoby_percent, by_fixed, cart_fixed, buy_x_get_y
discountAmountFloatNoDiscount value; capped at 100 when actionType is by_percent
discountQuantityIntNoQuantity for buy_x_get_y
discountStepStringNoBuy-step for buy_x_get_y
applyToShippingIntNo1 applies the discount to shipping too
freeShippingIntNo1 grants free shipping
conditionTypeIntNo1 match all conditions / 0 match any
conditionsArrayNoCart / product condition filters
endOtherRulesIntNo1 stops lower-priority rules from also applying
usesAttributeConditionsIntNo1 when conditions use product attributes
usagePerCustomerIntNoPer-customer usage limit (0 = unlimited)
usesPerCouponIntNoPer-coupon usage limit (0 = unlimited)
sortOrderIntNoPriority — lower runs first
statusIntNo0 inactive / 1 active
startsFromStringNoStart date (ISO 8601) or null
endsTillStringNoEnd date (ISO 8601) or null; must be >= startsFrom

Released under the MIT License.