Billing Model¶
Spendware connects usage tracking to billing primitives that support internal reporting and customer invoices.
Important: Stripe is used only for Spendware's own SaaS platform billing — charging you for your Spendware subscription. Stripe is NOT involved in metering, invoicing, or billing your end-customers. Spendware handles all end-customer billing natively through its own billing cycles, invoices, ledger, and templates. You do not need a Stripe account, Stripe API keys, or any Stripe integration to bill your customers through Spendware.
Core Objects¶
- Plans define commercial packages, base fees, included usage, and limits.
- Subscriptions attach plans to organizations.
- Pricing rules describe provider/model cost behavior.
- Billing templates control billing document layout and rule presentation.
- Billing cycles summarize customer usage and charges over a period.
- Billing ledger records line-item style charge history.
- Customer credit grants and allocations form a separate immutable ledger. Grants offset eligible customer spend as accepted usage consumes them; they are not billing-ledger entries or fixed invoice discounts.
Customer Credit Consumption¶
An optional customer_credit_consumption billing-template rule renders actual
usage-credit consumption as a negative invoice line. It runs after ordinary
direct rules and is capped at the pre-credit subtotal, so an invoice cannot
become negative. The rule has presentation configuration only; its amount is
never configured statically.
Usage Units¶
Billing calculations use raw token and request counts. Presentation unit scaling is read-only and should not be used for ledger writes, guardrail thresholds, or price calculations.
Platform Billing¶
Spendware's own SaaS subscription billing uses Stripe for checkout, subscription lifecycle, and payment collection. This is entirely separate from your end-customer billing workflow. You interact with platform billing through the organization billing tab in the dashboard or the platform billing API endpoints.
Paid plans can be billed monthly or annually (the annual option is shown in checkout where the plan offers one), promotion codes can be applied in checkout, and failed subscription payments enter Stripe's dunning flow with a short grace window before request ingestion is blocked. Usage overage is invoiced from closed billing periods; payment is attempted automatically with Stripe's retry schedule. Where Spendware has tax registrations, checkout and usage invoices can include tax automatically.
Developer Workflow¶
Most developer integrations start by logging usage correctly. Billing automation can then read usage summaries, preview line items, generate invoices, and inspect billing ledger entries.