Billing overview
How billing works
PaymentKit handles recurring billing through three connected concepts: customers hold payment methods, subscriptions define billing schedules, and invoices track amounts owed.
When you create a subscription, PaymentKit:
- Generates an invoice for the first billing period
- Attempts payment using the customer’s default payment method
- Schedules the next billing cycle automatically
- Handles failures with smart retries and recovery emails
Subscription states
Every subscription exists in one of seven states. PaymentKit transitions subscriptions between states based on payment outcomes and scheduled events.
Create a subscription
Start billing a customer by creating a subscription with one or more prices.
Dashboard
API
Python SDK
- Go to Billing > Subscriptions
- Click Create Subscription
- Select a customer
- Add prices with quantities
- Set billing interval and start date
- Click Create
See Create a subscription for trial periods, discounts, and fixed-term options.
Pause a subscription
Temporarily stop billing without cancelling. The customer retains access through the paid period, and billing resumes automatically or on request.
Pause immediately
Pause at period end
Let the customer use the service through the paid period, then pause:
Auto-resume after a duration
Pause for a set number of billing cycles:
Or resume on a specific date:
See Pause a subscription for resume behavior and proration details.
Resume a paused subscription
Reactivate a paused subscription immediately:
Dashboard
API
- Go to Billing > Subscriptions
- Select the paused subscription
- Click Resume subscription
When resumed:
- A prorated invoice is created for the remaining time in the current period
- Payment is attempted on the prorated invoice
- The billing period advances to the next cycle
Cancel a subscription
End a subscription with control over timing and refunds.
Cancel immediately
Cancel at period end
Let the customer use the service through the paid period:
Cancel on a specific date
Schedule cancellation for a future date:
Refund options
Undo a scheduled cancellation
Remove a pending cancellation before it takes effect:
See Cancel a subscription for preview mode and refund calculation details.
Update a subscription
Change subscription fields
Update metadata, payment method, or other settings:
Update subscription items
Add, remove, or change items with proration control:
Proration behavior
See Update a subscription for upgrade/downgrade examples.
Reschedule billing
Change when the next invoice is generated:
Use is_preview: true to see the proration amount without applying changes.
Trial periods
Offer a free trial before the first charge:
During the trial:
- Subscription is in Trialing state
- A $0 invoice is generated for the trial period
- Three days before trial ends,
subscription.trial_will_endevent fires - At trial end, the subscription activates and billing begins
Fixed-term subscriptions
Create subscriptions that automatically end after a set number of billing cycles:
The subscription cancels automatically after 12 billing cycles complete.
Payment collection
Control how invoices are paid:
Set net_d to control when invoices are due. A value of 0 means due immediately. A value of 30 gives the customer 30 days after invoice finalization.
Failed payments and dunning
When a payment fails, PaymentKit automatically:
- Transitions the subscription to Past due
- Retries payment on a smart schedule
- Sends dunning emails with a link to update payment method
- Applies your configured end behavior if all retries fail
Dunning end behavior
Configure what happens when all retry attempts are exhausted:
See Automatic retries & emails for retry schedules and email configuration.
Preview upcoming invoice
See what the next invoice will look like before changes take effect:
The response includes line items, totals, and billing dates.
Webhook events
PaymentKit emits events at each subscription state change:
See Webhooks for setup and event handling.
Invoice states
Invoices track payment collection status:
See Create an invoice and Custom invoices for manual invoice management.