Cart Rule Coupons
A cart rule coupon is a coupon code that activates a coupon-gated cart rule. It mirrors the coupon table on the admin Marketing → Promotions → Cart Rules → Coupons screen, which sits inside a single cart rule.
How cart rule coupons work
A cart rule can be set to apply automatically or only when a shopper enters a coupon code (couponType 1 on the parent rule). When the rule is coupon-gated, these codes are what the shopper types at checkout to unlock the discount.
- One rule, many codes. Every coupon belongs to exactly one cart rule. The list is always scoped to a
cartRuleId, and codes from one rule never appear under another. - Primary vs. secondary. Each coupon has an
isPrimaryflag. The rule's single primary code is managed on the cart rule itself. The codes you create or generate here are secondary codes (isPrimaryisfalse,typeis1) — useful for handing out many distinct codes for the same promotion. - Two ways to add codes. Create adds one explicit code; Generate bulk-creates many random codes from a length, format, prefix and suffix.
- Usage limits.
usageLimitcaps total redemptions andusagePerCustomercaps per-customer redemptions.timesUsedis read-only and counts how often the code has been redeemed.expiredAtsets an expiry date. When omitted on create, these inherit the parent rule's values.
Operations in this menu
| Action | Operation |
|---|---|
| List | adminMarketingCartRuleCoupons query |
| Create | createAdminMarketingCartRuleCoupon mutation |
| Generate | createAdminMarketingCartRuleCouponGenerate mutation |
| Delete | deleteAdminMarketingCartRuleCoupon mutation |
| Mass Delete | createAdminMarketingCartRuleCouponMassDelete mutation |
This is a sub-resource of Cart Rules — every coupon belongs to one cart rule, and the list requires its cartRuleId.
All Cart Rule Coupons operations require an admin Bearer token — see Authentication.

