Subscriptions enable recurring revenue by automatically charging customers at regular intervals. Polar handles the complete subscription lifecycle including trials, upgrades, cancellations, and renewals.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/polarsource/polar/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Subscriptions in Polar:- Bill automatically at defined intervals (month, year, etc.)
- Support trials with automatic conversion
- Handle metered usage billing
- Manage seat-based pricing
- Apply discounts and credits
- Grant and revoke benefits automatically
Subscription Lifecycle
Creating Subscriptions
Via Checkout (Recommended)
Most subscriptions are created through the checkout flow:Programmatic Creation (Free Products Only)
Create free subscriptions directly via API:Subscription Status
- incomplete
- trialing
- active
- canceled
- past_due
- unpaid
- ended
Initial state. Payment setup in progress.
Updating Subscriptions
Subscriptions support several update operations:Change Product
Upgrade or downgrade to a different product:Proration Behaviors
Proration Behaviors
create_prorations: Generate credits for unused timealways_invoice: Charge immediately for the differencenone: Change takes effect at next billing cycle- Organization default used if not specified
Apply Discount
Add or change discounts:Discount changes take effect at the next billing cycle.
Extend or End Trial
Modify trial period:Update Seats
For seat-based subscriptions:Adjust Billing Period
Change the next billing date:Canceling Subscriptions
Cancel at Period End
Cancel but allow access until the current period ends:- Remains
activeuntil period end - Sets
cancel_at_period_end: true - Won’t renew at period end
- Benefits remain active until end
Revoke Immediately
Cancel and end subscription immediately:- Changes to
canceledstatus immediately - Benefits revoked immediately
- No refund issued
- No further charges
Subscription Billing
Billing Cycle
Subscriptions bill based on their interval:Charge Preview
Preview the next charge before it occurs:Metered Billing
For subscriptions with metered prices:Subscription Metadata
Store and update custom data:- Included in all API responses
- Sent in webhooks
- Searchable via filters
- Preserved across updates
Custom Field Data
Custom field values collected at checkout are accessible:Filtering Subscriptions
Query subscriptions with filters:Exporting Subscriptions
Export subscription data as CSV:- Customer email
- Creation date
- Active status
- Product name
- Price and currency
- Billing interval
Webhooks
Listen for subscription events:subscription.created
New subscription created
subscription.updated
Subscription modified
subscription.active
Subscription became active
subscription.canceled
Subscription canceled
subscription.revoked
Immediately revoked
subscription.ended
Subscription ended
Subscription Locking
Subscriptions are locked during updates to prevent race conditions:Best Practices
Cancellation Handling
Cancellation Handling
- Default to cancel at period end to maximize revenue
- Only offer immediate revocation when explicitly requested
- Track cancellation reasons via metadata
Upgrades & Downgrades
Upgrades & Downgrades
- Use
create_prorationsfor fair billing - Preview charges before making changes
- Consider deferring downgrades to next billing cycle
Trial Management
Trial Management
- Enable trials on products, not individual checkouts
- Track trial redemptions to prevent abuse
- Send notifications before trial ends
Usage Monitoring
Usage Monitoring
- Check meter consumption regularly for metered subscriptions
- Set up alerts for unusual usage patterns
- Use cap amounts to prevent surprise charges
Webhooks
Webhooks
- Listen for subscription.updated to track changes
- Handle subscription.ended to revoke internal access
- Use idempotency keys for webhook handlers
Common Patterns
Free Trial to Paid
Self-Service Upgrades
Pausing Subscriptions
API Reference
List Subscriptions
Query subscriptions with filters
Get Subscription
Retrieve subscription details
Create Subscription
Create free subscription
Update Subscription
Modify subscription
Revoke Subscription
Cancel immediately
Charge Preview
Preview next charge