Skip to main content
A coupon defines a discount — a percentage, or a fixed amount per currency — and how many subscription billing periods it applies to. Every coupon has its own code (set it when creating the coupon, or let Pancake generate one), and buyers can type it at checkout. To hand out more codes for the same discount, create promotion codes — up to 20 together with the coupon, and more at any time. A coupon also applies by its ID (couponId) on a checkout session. A coupon only limits redemptions by its expiry and total uses; buyer restrictions — buyer emails, uses per buyer and a minimum amount — are set on promotion codes, so the coupon’s own code has none. Coupons belong to a store and to one environment: a coupon created in test does not exist in prod, and the other way around.

Coupon Status Values

Discount Rules

Only name can change after creation. To change the discount, create a new coupon and deactivate the old one.

Code Format

The same rules apply to coupon codes and promotion codes:

Deactivation

Deactivation is permanent — there is no reactivate and no delete. Deactivating a coupon also deactivates all of its promotion codes and releases their codes. Existing orders are not affected. Discounts already attached to subscriptions keep applying until the subscription’s next plan change.

Safe Retries

Send an X-Idempotency-Key header (SDK: the idempotencyKey option) when you create a coupon, and reuse the same key when you retry. Without a key, a retry after a timeout returns 409 only when you specified the codes (code or promotionCodes[].code): the first request already created the coupon and took them. If you let Pancake generate the codes, the retry creates a second coupon. See Errors for the key requirements.

Reading Coupons

These endpoints only write. List and read coupons with GraphQL: coupons, couponsCount and coupon(id); their promotion codes with promotionCodes and promotionCodesCount.

Endpoints

Create Coupon

Create a coupon with its code and, optionally, its promotion codes.

Update Coupon

Rename a coupon.

Deactivate Coupon

Permanently deactivate a coupon and all of its promotion codes.