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

Create

$kit->coupons->create()#

Creates a new coupon and a matching promotion code in Stripe.

Signature#

Parameters#

FieldTypeRequiredDescription
codestringYesThe customer-facing code, for example "SUMMER25". Automatically uppercased. Must be unique in your Stripe account.
namestringNoInternal name shown in the Stripe Dashboard. Defaults to code.
discountType'percent'|'amount'YesWhether discountValue is a percentage or a fixed amount.
discountValuefloatYesFor 'percent', a number from 0 to 100. For 'amount', a major currency unit amount, for example 10.00 for €10, not minor units.
currencystringOnly for 'amount'3-letter ISO code. Defaults to the currency configured on init.
duration'once'|'repeating'|'forever'No, defaults to 'once'How many billing periods the discount applies for.
durationInMonthsintOnly with 'repeating'Number of months the discount repeats.
maxRedemptionsintNoTotal number of times this code can ever be redeemed across all customers.
expiresAtstringNoAny date string parsable by PHP's strtotime(), for example "2026-12-31" or "+30 days".

Example request#

Example response#

Errors#

ExceptionWhen
ValidationErrordiscountType is 'percent' and discountValue is outside 0–100; or required fields for the chosen duration are missing.
StripeOperationErrorThe code is already in use, or Stripe otherwise rejects the request.

Notes#

If a storage adapter is configured, the record is persisted via saveCoupon().
discountValue for 'amount' coupons is in major units (euros, dollars), unlike everywhere else in StripeKit where amounts are minor units. This is intentional, to match how a coupon amount is normally entered in an admin UI. See Money and currency.
Previous
Overview
Next
Validate
Built with