Subscription Lifecycle
A subscription represents a recurring payment agreement between you and your customer. Subscriptions automatically handle billing cycles, payment retries, and customer management. To help you understand the various subscription lifecycle scenarios, including relevant states and the webhook events triggered at each stage, see the diagrams below:Default Subscription Lifecycle
This diagram shows a standard subscription flow from checkout to cancellation, including payment failures and cancellations:
Trial Subscription Lifecycle
This diagram shows how subscriptions with free trials work, from checkout through the trial period to paid billing:
Paused Subscription Lifecycle
This diagram shows how subscriptions can be paused and resumed, including updates during the active period:
Subscription Status
A subscription can be in different states throughout its lifecycle:- Active: The subscription is current and payments are being processed normally.
- Canceled: The subscription has been terminated and will not renew or bill again.
- Unpaid: Payment for the subscription has failed or is overdue; access may be restricted until payment is made.
- Incomplete: Customer must complete payment within 23 hours to activate, or payment requires action (e.g., authentication). Also applies to pending payments with processing status.
- Paused: The subscription is temporarily paused (no charges are processed and billing is on hold).
- Trialing: The subscription is in a trial period before the first payment is collected.
- Scheduled Cancel: The subscription is scheduled to cancel at the end of the current billing period but is still active until then.
Billing Cycles
Subscriptions operate on billing cycles that determine when payments are collected:- Monthly billing - Charged every month
- 3 month billing - Charged every 3 months
- 6 month billing - Charged every 6 months
- Yearly billing - Charged annually
Creating a Subscription
To create a subscription:- Create a subscription product in your Creem dashboard (set billing type to “recurring”)
- Generate a checkout session for the subscription
- Direct your customer to the checkout URL
- Next.js
- TypeScript SDK
- Better Auth
- REST API
Next.js SDK Documentation
Learn more about the Next.js adapter and advanced features.
Handling Successful Subscriptions
After a successful subscription creation, users are redirected to yoursuccess_url with subscription details as query parameters:
Managing Subscription Access
Use webhooks to grant and revoke access based on subscription status. The Next.js and Better Auth adapters provide high-levelonGrantAccess and onRevokeAccess callbacks. With the TypeScript SDK, verify the webhook payload and handle the subscription event types directly.
How It Works
- Grant access when subscription events indicate the customer should have access, such as
subscription.active,subscription.trialing, orsubscription.paid. - Revoke access when subscription events indicate the customer should lose access, such as
subscription.pausedorsubscription.expired.
- Next.js
- TypeScript SDK
- Better Auth
- Manual Webhook
Next.js Adapter Documentation
Learn more about webhook handling and server functions.
Key Features
Free Trials
Learn how to set up trial periods for your subscriptions.
Seat-Based Billing
Implement per-seat pricing for team-based products.
Customer Portal
Enable self-service subscription management.
Discount Codes
Create discount codes for subscriptions
Managing Subscriptions
Learn how to update, upgrade, and manage active subscriptions
Cancellations & Refunds
Handle subscription cancellations and process refunds