1. Coupons
Documentation
  • Back to home
  • StripeKit
  • Installation
  • Getting Started
  • Choosing a Mode
  • Type Reference
  • Setup
    • Configuration
    • Timezones
    • Storage Adapter
    • Money and Currency
    • Error Handling
  • Stripe
    • Elements
  • Modules
    • Overview
    • Customers
      • Overview
      • List
      • Retrieve
      • Find or Create by Email
      • Create
      • Update
      • Sync
      • Delete
    • Payment Methods
      • Overview
      • Create Setup Intent
      • List
      • Attach
      • Detach
      • Set Default
      • Sync
    • Payments
      • Overview
      • Pay With Saved Method
      • Create
      • Retrieve
      • Confirm
      • Cancel
      • Sync
    • Checkout
      • Overview
      • Get
      • Create
      • Submit Fields
      • Apply Coupon
      • Mark Complete
    • Subscriptions
      • Overview
      • Create
      • Retrieve
      • Cancel
      • Resume
      • Toggle Collection Method
      • Update Fields
      • Apply Promotion Code
      • List By Customer
      • Find By Metadata
      • Sync
    • Invoices
      • Overview
      • Retrieve
      • List By Customer
      • List By Subscription
      • Pay With Saved Method
      • Void
      • Finalize
      • Sync
    • Coupons
      • Overview
      • Create
      • Validate
      • Apply To Subscription
      • List
      • Deactivate
    • Webhooks
      • Overview
      • Process
      • Events Reference
    • Sync
      • Overview
  1. Coupons

Overview

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.

Methods#

MethodDescription
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.

The KitCouponRecord shape#

code is always uppercased. description is a short, auto-generated human-readable summary, for example "25% off, once".
Previous
Sync
Next
Create
Built with