Skip to Content
API ReferenceCoupons

Overview

Create discount codes and choose who, what, and when they apply to.

Coupons apply an amount or percentage discount when a customer supplies a code. Choose which products qualify, how often the code can be used, and when it is valid. For discounts that apply without a code, use Promotions.

The response fields products and product_variants contain explicit product and variant IDs that determine where the coupon applies.

Coupons and their linked products must belong to the selected store. Track batch requests in your integration and check what changed after a lost response before retrying; batch writes do not have a general idempotency guarantee. Each endpoint documents its discount units, limits, and date fields.

Percentage discount caps

A PERCENTAGE coupon can take maximum_discount_amount, the most it takes off one order, as a decimal amount in the major unit of the order's currency: 20% off with a cap of 15.50 never takes off more than 15.50. Send null to remove the cap. An AMOUNT coupon can't have one, and changing a coupon to AMOUNT removes it. The v1 Coupons API ignores this field.

Subscription coupons

A coupon discounts one kind of purchase, set by applies_to. A one_time coupon, the default, discounts one-time purchases. A subscriptions coupon discounts the first subscription_payments payments of a subscription plan, from 1 to 36, counting the signup payment as the first. A 20% coupon with subscription_payments: 3 takes 20% off the signup and the next two renewals, and the fourth payment bills the full plan price.

  • A coupon only discounts order lines of its kind, and its minimum_amount is measured on those lines. The products and product_variants you add must be of its kind too, or the request returns 422.
  • A subscription coupon can't take 100% off. Offer a free trial instead.
  • Stripe and payment methods the store bills in house carry the discount. On Stripe, more than one discounted payment needs a monthly or yearly plan. PayPal and Razorpay sell the plan at its full price, and the order is created without the coupon.
  • A subscription coupon doesn't apply to a plan that starts with a trial, or to a charge.
  • Renewals keep the discount but not the coupon: a renewal order's coupon_id is null, so the coupon's limit counts each subscription once.

Subscription discounts explains how renewals bill and what ends the discount early.

Endpoints

On this page