Applying Coupons
Coupons can be applied at the point of subscription creation, or to an existing active subscription.Applying at checkout
Pass acoupon option to CreateSubscription:
Applying to an active subscription
Use theApplyCoupon action to attach a coupon to a subscription that already exists:
subscriber.coupon-redeem component
For custom checkout flows that don’t usesubscriber.plan-picker, the subscriber.coupon-redeem Livewire component handles validation and session storage:
How it works
- The user enters a coupon code and submits the form.
- The component validates the code using
Coupon::isValid()— checking expiry and maximum redemptions. - On success, the code is written to
session('subscribd.pending_checkout')['coupon']. - When
subscriber.checkoutprocesses the subscription, it reads the session key and passes the coupon toCreateSubscription. - The browser event
subscribd:coupon-validatedis dispatched with{ code }.
Named subscription slot
Scope the component to a named slot when using multiple subscriptions:Removing a coupon
Remove a coupon from an active subscription:Checking whether a coupon is applied
Next steps
- Creating Coupons — Define coupon codes and rules
- Feature Grants — Grant feature access via coupon