Commerce
updateCoupon
Update Coupon
Change what an existing coupon is worth or who may redeem it: value, minimum cart, window, redemption limits, or status (active / paused / archived).
Arguments
appIdstringrequiredThe Studio app ID whose shop owns the coupon.couponIdstringrequiredThe coupon ID (from listCoupons).statusstringoptionalactive redeems; paused stops new redemptions reversibly; archived retires it.valuenumberoptionalNew value in the coupon's own kind: minor units for a flat code, whole percent for a percent one.minSubtotalMinorintegeroptionalSmallest cart the code works on, in minor units (2000 = a $20 cart). Omit for no minimum.startsAtnumberoptionalEpoch ms the code starts working. Omit to start immediately.endsAtnumberoptionalEpoch ms the code stops working. Omit for no expiry.maxRedemptionsintegeroptionalTotal redemptions across all buyers, ever. This is the HARD bound: it holds even for an anonymous checkout with no email. Omit for unlimited.perCustomerLimitintegeroptionalRedemptions allowed per buyer. Counted per email, so it only bites where a buyer identity is known before payment; maxRedemptions is what always holds.firstOrderOnlybooleanoptionalRedeemable only by someone with no paid order at this shop yet. Same identity caveat as perCustomerLimit.
Returns
The registry does not declare a return shape.
Declared limits
value: greater than 0minSubtotalMinor: minimum 0minSubtotalMinor: maximum 9007199254740991maxRedemptions: greater than 0maxRedemptions: maximum 9007199254740991perCustomerLimit: greater than 0perCustomerLimit: maximum 9007199254740991
Ask for it
The Cloud routes these requests to this verb.
- make SAVE5 ten dollars instead
- give that code an expiry
- limit it to one per customer
- turn that coupon back on
Pair it with
The verbs that finish the job.