Concepts
Subscriptions and invoices
How a subscription and its invoices behave: statuses, when the period moves, holds while a charge is being confirmed, plan changes, cancels, refunds, the customer portal, and what runs only on test clocks in this release.
A subscription (sub_...) charges one customer's saved card for one recurring price, billed every 1 month or every 1 year. Every charge is a payment (pay_...) on an invoice (in_...). Amounts are integer cents (2900 = $29.00) and times are Unix seconds. The objects use Stripe's field names; Billing webhooks lists where they differ.
Test mode only in this release
Billing runs in test mode. A subscription's first charge happens when it is created, but the scheduler that renews subscriptions on real time is not switched on yet. Renewals, retries, reminders (invoice.upcoming) and period ends run when you advance a test clock. A live merchant is refused with billing_unavailable. Do not promise your users live billing until ZeroPoint switches it on for your platform; going-live says what that will take.
Two ways to start one
- Hosted checkout with
mode: subscription: the buyer types a card on ZeroPoint's page, the card is saved and charged, andcheckout.session.completednames the subscription. Start here: Sell a subscription in five calls. POST /v1/subscriptions(MCPcreate_subscription) when your customer already has a saved card (pm_...), for example a plan change from a free tier.
Statuses
| Status | Meaning | Access |
|---|---|---|
incomplete | The first payment was declined (or is still being confirmed). The customer can pay latest_invoice with another card within 23 hours. A declined hosted checkout also leaves one, with no event: it becomes active when a later card on that session is captured, or incomplete_expired when the session expires | No |
incomplete_expired | The first payment never succeeded. Final | No |
active | Paid for the current period | Yes |
past_due | A renewal was declined; retries are scheduled. The last declined retry takes the final action at once | Your choice: a grace period, or a banner asking for a new card |
unpaid | Retries are over and the merchant's final action is unpaid; the invoice stays payable until its period ends | No |
canceled | Ended. Final | No |
Gate access on status, never on current_period_end. The period moves forward only in the change that proves a renewal was captured, so a declined renewal shows past_due with the period that has ended. Code that compares current_period_end with now cuts a customer off at the first decline, and grants nothing during a hold.
Holds: a charge whose outcome is unknown
A charge has three outcomes: captured, declined, or unknown (a timeout, or a processor answer that cannot be confirmed). Unknown is never treated as declined. While a charge is unknown:
- the subscription keeps its status and
payment_holdis set ({invoice, since}); - the invoice stays
openwithcollection_status: reconciling; - no
invoice.payment_failed, no status change and no cancel; - paying or voiding the invoice answers
409 invoice_reconcilingwithRetry-After: 300; a plan change answers409 renewal_duewithRetry-After: 120. While the charge is still in flight, before the hold, pay and void answer409 invoice_payment_in_progresswithRetry-After: 30.
A customer.subscription.updated whose only change is payment_hold means "a charge is being confirmed": do nothing. When the outcome is proven, the hold clears and the usual events follow (invoice.paid, or invoice.payment_failed).
Retrying a create or a change
A create, a plan change and an invoice payment take a key (the Idempotency-Key header, or request_key on the MCP tools). A retry with the same key and the same body returns the first answer and never charges twice, also after a 502 or a lost answer. Never retry a create with a new key: a new key is a new subscription. If you lost the answer, retry with the same key, or list the customer's subscriptions.
Plan changes and cancels
- Upgrade (same interval, dearer price) or monthly to annual: charged now, the prorated difference in integer cents. The plan changes only after that payment is proven captured. A difference below the minimum charge (50 cents by default) applies the plan now and is added to the next renewal.
- Downgrade, lateral change, annual to monthly: scheduled for
current_period_end(scheduled_change); nothing is charged or credited now. cancel_at_period_end: true: active until the period ends, then canceled. Whilepast_due,unpaidorincompleteit cancels at once.DELETE /v1/subscriptions/{subscription_id}: cancels now. Nothing is refunded.
Details and examples: Upgrades, downgrades and cancel.
Refunds and voids do not end a subscription
A refund or a void of a subscription payment uses the payment routes (POST /v1/payments/{payment_id}/void before settlement, POST /v1/payments/{payment_id}/refund after it). It never cancels or changes the subscription by itself: the invoice stays paid with amount_paid unchanged and no refund mark, and the portal's history still reads Paid. The reversal shows only on the payment (amount_refunded_cents, its refunds and its receipt) and in refund.succeeded. If service should end, cancel the subscription yourself. An upgrade later credits only money still held.
Promotion codes on renewals
A subscription has at most one discount. A once coupon applies to the first invoice only; repeating for its number of months from the start; forever always. The window is fixed when the subscription starts and never restarts. Known revenue leak, the same as Stripe: a customer inside a repeating window who switches monthly to annual gets the discount on the whole year's invoice. If that matters, end the discount before you offer the switch.
discounts on the subscription (coupon, promotion_code, start, end) keeps listing a repeating discount after its window has ended: end is then a time in the past, and the renewal, the preview and the portal charge the full price. Compare discounts[].end with now before you show a discount as active.
The customer portal
POST /v1/billing_portal/sessions (MCP create_portal_session) returns a one-time url to a hosted page where your customer sees their plan and next charge, cancels at period end (and undoes it), updates their card and pays an open invoice. Redirect your signed-in user to it at once: it works once and expires 5 minutes after it was created. Never email it, store it or show it; create a new session per click.
ZeroPoint sends no email to your customers
Renewal reminders, receipts and failed-payment notices are yours to send. Send them from the billing events: invoice.upcoming (3 days before a renewal by default), invoice.paid, invoice.payment_failed (read its billing_reason: only subscription_cycle is a failed renewal), customer.subscription.deleted.
object_version
Billing events carry data.object_version, which rises with each change of the object. Use it only to decide whether to overwrite your stored copy (overwrite when the event's version is greater than or equal to yours). Never use it to skip a handler: one change can send two events at the same version.
Not available yet
Trials, quantities above 1, several items per subscription, metered or tiered prices, billing_cycle_anchor, pausing collection, subscription schedules, tax, and previewing a brand-new subscription before it is created. Previewing a plan change works: POST /v1/invoices/create_preview with subscription and subscription_details (MCP preview_invoice; Upgrades, downgrades and cancel).