options[]. A billingCycle option sets when recurring charges run. Per-unit charge and tier options set usage rates. A limit option sets included usage. See Plans for the option catalog.
Credits are only the prepaid wallet. Usage rates are money per meter noun. See Plans and billing glossary.
Billing cycles
AbillingCycle option makes the plan recurring:
Quarterly is
{ "kind": "billingCycle", "interval": "month", "count": 3 }. There is no quarterly or custom cycle enum.
The cycle drives:
- When the next payment is due (
nextBillingDateon the purchase) - The window for usage aggregation (
periodStarttoperiodEnd) - When included usage resets
billingCycle is one-time (flat charge only) or usage-based (metered, billed as usage happens).
How usage is billed
Metered usage comes from usage events on a meter. The HTTP path staysPOST /v1/sdk/meter-events.
Overage is usage beyond the included cap, charged per meter noun. A plan with no limit bills every counted item.
Limit checks:
- Find the active purchase for the customer and product
- Read the frozen
planSnapshot.options - If the meter’s
limit.capis0, allow immediately - Sum usage events for that meter in the current period
- Compare against
cap. The leftover included count isLimitResponse.remaining(-1means unlimited)
remainingUnits) is separate: how many metered items the credit balance still covers. Do not mix the two remainings.
A provider-level minimum top-up (minTopUpMinor in SolvaPay Console settings) applies to every credit top-up and auto-recharge for that provider. Amounts below it are rejected. See Auto-recharge.
Purchase states
A purchase moves through these states:Reactivation
When a customer cancels a recurring purchase, it staysactive with cancelledAt set until the period ends.
cancelledAt and restores auto-renew. A purchase.updated webhook fires.
Preconditions: the purchase must be active, have cancelledAt set, and endDate must not have passed.
Plan switching
CallactivatePlan with the new plan reference. If the customer already has an active purchase on a different plan for that product:
- The existing purchase expires
- A new purchase is created on the requested plan
purchase.expired for the old purchase and purchase.created for the new one.
Usage on the purchase
Each metered purchase can carry ausage subdocument for the current period. The source of truth is the usage timeseries, not usage.used. Limit checks sum events from periodStart to now.
Recurring renewal
A daily job renews purchases whosenextBillingDate has passed and that still auto-renew:
- Charge the recurring flat
charge(and any due usage) whenrequiresPaymentis true - Advance
nextBillingDateby thebillingCycleinterval
requiresPayment is derived: any positive charge or tier amount.
Trial end
Atrial option sets days and onEnd (convert, cancel, or downgrade). When the trial ends:
convert— move to the paid plan termscancel— end accessdowngrade— move todowngradeToPricingId
Usage reset and rollover
When a period ends, included usage resets with the newperiodStart. A rollover option can carry unused included usage forward (carry_forward) or forfeit it. Advancing periodStart resets visible usage without deleting usage events.
Next steps
- Plans — compose pricing from options
- Plans and billing glossary — credits, meter noun, included vs wallet remaining