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.
Included usage needs a billing cycle. A pay-as-you-go plan cannot carry a limit.
Overage is usage beyond the included cap.
draw_credits pays it from prepaid credits as each request is served, and denies the request when the balance cannot cover one unit. On a recurring plan with no limit, every counted item is paid from prepaid credits the same way. Usage is never billed to the card.
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)
freeAllowance (a free-* meter), the check skips the purchase snapshot and counts usage against that cap instead. Denial sets paywallReason: 'limit_reached'. remaining / used / limit still report the free-meter remainder. See Add a free allowance to MCP tools.
Wallet coverage (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
An SDK purchase carries the billing period of the active usage window. It does not carry counts.used, remaining, and limit come from POST /v1/sdk/limits. That check sums usage events from periodStart to now.
Recurring renewal
A daily job renews purchases whosenextBillingDate has passed and that still auto-renew:
- Charge the recurring flat
chargeoff-session on the card saved at checkout, whenrequiresPaymentis true - Advance
nextBillingDateby thebillingCycleinterval only after that charge is collected
past_due and does not move nextBillingDate. Access continues while retries run. requiresPayment is derived: any positive charge or tier amount.
Recurring checkout saves the card for later renewals and failed-payment retries.
Trial end
Atrial option sets days and onEnd (convert or cancel). When the trial ends:
convert— charge the plan off-session and move to the paid terms. If that charge cannot be collected, the purchase becomespast_duecancel— end access
cancel plus an auto-assigned free plan on the product. The customer lands on that free plan when the trial ends. There is no downgrade target on the trial option.
Usage reset
When a period ends, included usage resets with the newperiodStart. Unused included usage does not carry over. 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