1. Subscriptions
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. Subscriptions

Apply Promotion Code

kit.subscriptions.applyPromotionCode()#

Applies a coupon's promotion code to an already-active subscription, discounting future invoices.

Signature#

Parameters#

FieldTypeDescription
subscriptionIdstringThe subscription to discount.
stripePromotionCodeIdstringA Stripe promotion code ID (starts with promo_), not the plain-text code a customer types.

Getting a promotion code ID from a plain-text code#

See Coupons — validate().

Example response#

Same shape as retrieve()'s response.

Errors#

ExceptionWhen
StripeOperationErrorThe subscription or promotion code ID does not exist, or the promotion code is no longer active.

Notes#

If a storage adapter is configured, the record is persisted via saveSubscription() after applying.
This overwrites any promotion code currently applied to the subscription; Stripe subscriptions can only have one active promotion code at a time.
Previous
Update Fields
Next
List By Customer
Built with