$kit->coupons creates, validates, applies and deactivates coupons and promotion codes. Every coupon StripeKit creates is backed by both a Stripe Coupon (the discount rule) and a Stripe PromotionCode (the customer-facing code), which is why StripeKit's records always carry both a stripeCouponId and a stripePromotionCodeId.| Method | Description |
|---|---|
create() | Create a new coupon and its promotion code. |
validate() | Check whether a plain-text code is currently valid, without throwing. |
applyToSubscription() | Apply a promotion code to a subscription. Thin alias, see notes. |
list() | List active coupons. |
deactivate() | Deactivate a promotion code so it can no longer be redeemed. |
KitCouponRecord shapearray{
code: string,
stripeCouponId: string,
stripePromotionCodeId: string,
name: string,
discountType: 'percent'|'amount',
discountValue: float,
currency: string|null,
duration: string,
durationInMonths: int|null,
maxRedemptions: int|null,
timesRedeemed: int,
expiresAtUtc: string|null,
active: bool,
description: string,
}code is always uppercased. description is a short, auto-generated human-readable summary, for example "25% off, once".