
Grandfather Pricing: Types, Trade-Offs & How to Implement It
Learn how grandfather pricing works, its four types, financial trade-offs and 6 steps to manage legacy plans without disrupting customer access.
An automated billing system generates invoices, collects payments and runs dunning. Learn how it works, its benefits, setup steps and where rules stop.
An image generation product receives the same invoice.paid webhook on two deliveries. The credit-grant job runs both times, and the customer's wallet holds double the credits they bought.
The ledger has no record explaining the extra balance until someone reconciles it by hand. An automated billing system depends on every job reading the same account state.
The sections below cover how these systems work, what they offer, how to set one up, and where scheduled rules stop.
An automated billing system is software that generates invoices, collects payments and handles routine tasks such as retries and dunning without a person triggering each step.
It runs on rules. A defined condition is checked, and a defined action follows.
The main difference between manual and automated billing is who runs the repetitive steps. Manual billing has a person create, check, and send each invoice. Automated billing, on the other hand, runs the same rules against every account.
Automation handles the situations someone anticipated when writing the rules. A refund issued outside the normal flow or a plan change that matches no rule needs a person to step in, because a rule cannot recognize a case nobody wrote it for.
Billing automation covers five recurring tasks, and each one fires on a specific event. Each task reads its own view of the account, so stale data breaks each one in a different way.
| Task | Trigger | What breaks on stale state |
|---|---|---|
| Invoice generation | The billing cycle date arrives | The invoice is built from an old plan or usage total |
| Payment retries | A charge fails | A retry fires after the customer already paid |
| Dunning sequences | A payment stays unresolved past a set threshold | A suspension lands on a paid account |
| Proration | A plan changes mid-cycle | Credit is calculated against the wrong plan version |
| Tax calculation | An invoice is generated for a taxable region | The wrong region is applied to the invoice |
Every row works as long as the account data it reads is current. The next section shows how the pieces fit together.
An automated billing system moves account data through five stages, from customer and pricing data intake to reminders and retries:
Every stage writes back to one account record, so a bad value at stage 2 flows into every stage after it. Our guide to billing management covers who owns each stage and how the work is organized.
The benefits of an automated billing system are time saved, fewer errors, faster cash flow, and fewer missed renewals. Each one comes from running the same rules against every account:
When pricing stops being predictable, missed invoices and failed retries feed revenue leakage in AI products.
An automated billing system runs on four components within its billing system architecture: a rules engine, a scheduler, a webhook or event layer, and a state store.
| Component | What it does | Failure mode |
|---|---|---|
| Rules engine | Evaluates conditions against events and triggers the matching action | Two rules match one event and fire in the wrong order |
| Scheduler | Checks time-based triggers on a recurring interval | Clock drift or a timezone mismatch fires a job early or late |
| Webhook or event layer | Receives and emits events so other systems react without polling | Duplicate delivery reprocesses an event |
| State store | Holds current account data that every other component reads and writes | A read before a commit returns stale data |
The rules engine of a billing engine evaluates a condition against incoming event data and runs the matching action. A single event, such as a failed payment, can match several rules, so engines add priority or ordering. A dunning rule looks like this:
{
"rule_id": "dunning_retry_1",
"condition": {
"event": "payment_failed",
"attempt_count": { "less_than": 3 }
},
"action": {
"type": "retry_payment",
"delay_hours": 72
}
}
The scheduler decides when to ask the rules engine whether something should happen. A fixed cadence is where many timezone and clock-drift bugs begin, because a billing cycle date depends on which clock counts.
The webhook layer receives provider events. Each event needs signature verification, deduplication, and idempotent processing before anything downstream acts on it.
The state store holds balances, subscription status, and payment history. Two components that read the same account before one write commits will disagree, even when each is implemented correctly.
Look for 6 core billing features and 5 engineering checks in an automated billing system. Use the tables when you compare billing systems or audit an in-house build.
| Feature | What it does | What breaks without it |
|---|---|---|
| Recurring billing | Generates an invoice on each plan's cycle and prorates mid-cycle changes | A mid-cycle upgrade bills the old price |
| Usage-based invoicing | Turns metered events into invoice line items | Late events miss the invoice or count twice |
| Dunning | Retries failed charges and sends notices on a set schedule | Retries fire against invoices already paid |
| Tax | Calculates tax by region when the invoice is created | The wrong region's rate lands on the invoice |
| Payment gateways | Collects payment through a processor such as Stripe | Duplicate gateway events repeat actions |
| CRM and ERP integrations | Syncs customer, deal and invoice data with Salesforce, HubSpot or NetSuite | Customer records diverge between systems |
Billing providers such as Stripe Billing, Chargebee, and Zuora are built around these 6 features.
The next five checks decide whether the system holds up when usage is continuous and pricing changes often.
| Check | What it does | What breaks without it |
|---|---|---|
| Real-time decisioning | Checks credit balances and limits while the request runs | Overuse surfaces in the next batch run, after the cost is spent |
| Audit trail | Records the event and rule version behind each automated action | A charge cannot be explained line by line |
| Idempotent webhook handling | Deduplicates events by key before processing | A redelivered event creates a second invoice |
| Billing-provider independence | Keeps plans, entitlements and usage outside the billing vendor | Switching providers means rebuilding access logic |
| Rule changes without deployment | Lets a non-engineer adjust rules in a UI | Every pricing tweak waits on a release |
Stigg adds real-time decisioning, an audit trail of every credit grant and deduction, and no-deploy packaging changes next to your billing provider.
It connects to Stripe Billing and Zuora through native integrations, and lists Chargebee, Metronome and Orb as billing integrations alongside them.
To set up an automated billing system, work through five steps in order, because each one feeds the next:
Spend the most time on edge-case testing. A duplicated webhook or an off-flow refund will break an untested rule in production, and a sandbox is a much cheaper place to learn this.
Idempotency works in automated billing by attaching a unique key to every event and checking it before the handler runs, so a repeated event produces the same result as the first.
Webhook handling is where this matters most, because providers deliver webhooks at least once and the same event can arrive more than once.
The handler looks up the idempotency key in a short-lived store. A key already seen gets acknowledged and dropped, and a new key gets processed and recorded.
Without the check, a duplicated payment_failed webhook starts 2 retry sequences for 1 failed charge, and a duplicated invoice.created event will generate the same invoice twice.
Credit-based products carry the same risk on debits and grants. A retried call that debits a wallet two times leaves a balance nobody can explain, which is why some credit engines reserve credits before an AI operation runs and settle the real cost once it finishes.
The most common failure modes in automated billing systems are race conditions, stale state, untested rule interactions, duplicate webhooks, and single-clock scheduling. Each one is a spot where two components disagree about the same account:
Each pattern traces to one root problem. Components get built and tested in isolation, then must agree in production, and nobody verifies the agreement until a customer reports a wrong invoice.
Three well-known products show what automated billing looks like when usage drives the bill.
OpenAI API. Developers buy prepaid credits, and the balance goes down as they use the API. With auto recharge turned on, OpenAI buys more credits when the balance falls below a threshold you set, so no one has to top up by hand.
Twilio. Usage for messages, calls, and phone numbers is deducted from your account balance as you use those services. Auto recharge refills the balance from your saved payment method once it drops to a threshold you choose, which keeps your project from being suspended at zero.
AWS. EC2 On-Demand instances running Linux or Windows are billed per second, with a 60-second minimum, and the usage adds up on your monthly bill. AWS Budgets sends alerts when actual or forecasted costs pass the budget you set.
An automated billing system stops working when a decision has to be made while the request is running. Scheduled rules check conditions in batches, and a batch cannot answer a question about state that changed seconds ago.
Billing automation cannot confirm whether that customer holds enough credits for the request in flight.
Usage is continuous, and the schedule is not. Three kinds of limits each need an answer at the moment of the request:
For flat recurring pricing, scheduled automation is the right tool. That changes when credits, tokens, or agent actions carry marginal cost on every call. An agent can burn a month’s credit budget overnight, and a nightly billing job only sees it the next morning.
The request-time check is called an entitlement. Entitlements are commercial allowances for feature access based on the plan a customer subscribed to, with measurement and consumption limits added.
A free plan gets a fixed monthly allowance, and a paid plan gets a higher cap. Entitlements come in four types:
A hard limit blocks the request at the cap, and a soft limit lets usage continue past it.
RBAC decides who may act. Entitlements decide how much of a feature the plan allows, resolving from the active plan, add-ons, trials, and promotional overrides, with the most generous value winning.
Your billing jobs keep ownership of invoices, retries, and dunning. A usage runtime answers the request-time question for them, using one current definition of pricing, packaging and usage.
Without that shared definition, the billing provider and the app each keep their own version of what a customer is allowed, and the two drift apart.
Stigg is the usage runtime for AI products. Entitlements, credits, and AI usage control are enforced in the request path.
Stigg works alongside your billing automation and your billing provider. Stripe handles payments while Stigg handles what's allowed.
Stigg's entitlement checks run at a P99 under 10ms. The check runs on every request, so latency decides whether enforcement can sit in the request path.
Your automated billing system can stay where it is. Stigg adds the enforcement layer next to it, so a credit balance, a plan limit, or a budget cap gets checked while the request runs. Here is how the architecture fits your stack:
Curious how the request path would look in your stack? The Stigg docs walk through the Sidecar and SDK setup, or you can talk to a human about where the layer fits next to your billing provider.
The main difference between automated billing and manual billing is who runs the repetitive steps. Manual billing has a person create, check, and send each invoice, while automated billing runs the same rules against every account without intervention.
No, an automated billing system is not the same as a payment gateway. The gateway moves the money, and the billing system decides when to invoice, retry a charge, or send a dunning notice, then calls a gateway to run the transaction.
No, an automated billing system cannot stop a customer from overusing a service in real time on its own, because scheduled rules react after usage is recorded. Blocking overuse during the request takes a real-time entitlements layer that runs alongside your billing provider.
The best automated billing system for recurring billing is the one that handles invoicing, dunning, and tax for your regions without custom code. Stripe Billing is the most common default for AI products, and Stigg integrates with it natively.
Zuora also has a native Stigg integration, and Chargebee is also on Stigg’s list of billing integrations. Pair any of them with a usage runtime when pricing depends on credits or tokens.
An automated billing system sends a duplicate invoice when a webhook or scheduled job processes the same event twice without an idempotency check. A unique event ID checked before processing blocks the second run.