With postpaid billing (the default), Monigo generates an invoice at period-end and then collects payment via your connected payment provider. With prepaid billing, the customer maintains a wallet balance and Monigo debits that wallet atomically when the invoice is generated — no separate payment step required. Prepaid works best when:Documentation Index
Fetch the complete documentation index at: https://docs.monigo.co/llms.txt
Use this file to discover all available pages before exploring further.
- Customers pre-purchase credits (SaaS with top-up model, APIs with token packs)
- You need deterministic settlement at billing time with no failed-payment recovery loops
- Your customers are API-first businesses that want to fund accounts rather than maintain card-on-file
Prepaid billing is only available on collection plans. Payout plans always use postpaid flow.
How it works
When the customer tops up their wallet with enough funds, Monigo automatically retries billing and resumes the subscription — no manual intervention needed.Setting up a prepaid plan
Add"billing_mode": "prepaid" when creating a collection plan:
billing_mode field on a plan defaults to "postpaid" and is immutable once the plan has active subscribers.
Wallet auto-creation
When a customer subscribes to a prepaid plan, Monigo automatically creates a wallet in the plan’s currency if one does not already exist. No explicit wallet-creation step is needed. You can fetch or top-up a customer’s wallet at any time:The happy path: billing with sufficient balance
When billing runs and the wallet has enough funds, Monigo:- Aggregates usage for the period
- Calculates the invoice total using the plan’s prices
- Debits the wallet atomically (debit is recorded in the ledger)
- Creates the invoice directly with
status: "paid"— no draft or finalize step - Advances the subscription to the next period
- Fires an
invoice.paidwebhook
| Field | Value |
|---|---|
status | "paid" |
paid_at | Timestamp of the debit |
wallet_debit | true |
Handling insufficient balance
If the wallet balance is lower than the invoice total when billing runs:- A draft invoice is created as an audit record (period is not advanced)
- The subscription status moves to
"paused" - A
subscription.prepaid_balance_insufficientwebhook is fired
Auto-resume on top-up
When you credit a wallet belonging to a customer with a paused prepaid subscription, Monigo:- Checks whether the new balance covers the outstanding invoice total
- If yes: retries billing immediately — debits the wallet, creates the invoice as
"paid", and moves the subscription back to"active" - If still insufficient: leaves the subscription paused
invoice.paid webhook as a normal billing cycle.
Webhook events
| Event | When fired |
|---|---|
invoice.paid | Wallet debit succeeded; invoice created as paid |
subscription.prepaid_balance_insufficient | Balance too low; subscription paused |
customer.wallet.topped_up | Wallet was successfully credited |
Customer portal
When a customer views their subscriptions in the customer portal, prepaid subscriptions display:- A Prepaid badge next to the subscription status
- Their current wallet balance alongside the estimated period total
- A warning and Top up wallet → link when the balance is below the estimated total
Comparing prepaid and postpaid
| Postpaid (default) | Prepaid | |
|---|---|---|
billing_mode | "postpaid" | "prepaid" |
| Invoice created | As draft, then finalized | Directly as paid |
| Payment collection | Via payment provider (card/bank) | Debited from wallet |
| Failed payment | Retry logic + dunning | Subscription paused |
| Recovery | Automatic retries | Customer tops up → auto-resume |
| Best for | SaaS with card-on-file | APIs with credit/token packs |
Related
- Billing Cycle — how periods work and when billing runs
- Subscription Lifecycle — pause, resume, and cancel behavior
- Invoice Lifecycle — invoice states and transitions
- Webhooks — receiving billing events
- Customer Portal — wallet balance visibility for customers

