%20(1).png)
Pricing and Packaging for AI Products: A 7-Step Guide
Pricing and packaging for AI products: a 7-step guide to choosing models, setting credits, defining limits, and testing plans.
See how billing integrations keep payments, credits, entitlements, and product state aligned, and how to prevent failures before they reach customers.
%20(1).png)
We’ve found that billing integrations rarely become painful during the happy path. The trouble starts with failed webhooks, duplicate events, refunds, mid-cycle upgrades, and customers who somehow end up with different states across three systems.
A billing integration is the infrastructure that keeps those systems aligned. For AI products, getting that right can directly affect credits, access, spend limits, and whether the next request is allowed to run.
A billing integration connects a billing or payment system with another application, so customer, subscription, usage, payment, or financial state can move between them without someone manually reconciling spreadsheets at the end of the month.
That "another application" could be several different things:
For AI products specifically, that last one is where things get interesting. The integration often determines whether a financial event, a payment, a refund, or a plan change also affects credits, entitlements, limits, or what the product will actually allow a customer to do next.
Billing integrations move commercial state between systems and make sure each system reacts correctly to the same event. Most rely on APIs, webhooks, event streams, or queues to keep payments, subscriptions, credits, entitlements, and customer records in sync.
The flow starts when something changes. A customer might complete checkout, upgrade a plan, purchase more credits, receive a refund, or sign a new enterprise contract.
That event triggers a state change that other parts of the stack may need to be aware of.
The billing or payment provider usually exposes the change through a webhook, API response, or event stream.
For example:
Payment succeeds → payment_succeeded event is emitted
The receiving system should validate the event before acting on it, including its event ID, customer ID, event type, timestamp, and payload.
This is where the real application logic begins.
A successful credit purchase might trigger:
Payment succeeds → credit grant created → wallet balance updated → ledger entry recorded
A plan upgrade could update entitlements and usage limits instead. A refund might require revoking unused credits or adjusting the customer's balance.
From there, the integration updates whatever product state depends on that event, whether that is a credit balance, entitlement, or usage limit.
One billing event can affect several services. A plan change might need to reach the product, CRM, data warehouse, accounting system, and customer dashboard.
These updates do not always need to happen at the same speed. Accounting can usually tolerate an asynchronous sync. A credit balance that determines whether an AI agent can continue running may need to be updated much more frequently.
Production integrations also need a recovery path when synchronization fails. The goal is to keep downstream state consistent even when an event is delayed, or a step in the workflow does not complete.
That makes idempotency, retries, durable event storage, and reconciliation core parts of the architecture.
The goal is a consistent state across the stack, even when the happy path breaks.
Billing integrations differ mainly in what crosses the system boundary and how quickly the receiving side needs to react. A payment event, contract update, and warehouse sync may all involve billing data, but they have very different latency and reliability requirements.
Payment processor integrations connect your billing layer to providers such as Stripe or Adyen. They carry events around payments, refunds, failed charges, invoice settlement, and payment method changes.
Payment status should remain anchored to the processor, while downstream systems react to those financial events. That boundary becomes especially important for refunds, failed payments, and asynchronous settlement, where product state may need to change later.
Let’s say a customer upgrades their plan, and their payment succeeds. What should change inside the product?
That may include access to new features, a larger credit balance, higher usage limits, access to premium models, or a larger agent budget. Product and entitlement integrations carry those commercial changes into the application itself.
Product and entitlement integrations sit closer to application behavior, since a commercial change can alter what features, models, or capacity the customer has access to.
Enterprise pricing often starts outside the billing system. Sales may negotiate custom rates, commitments, contract dates, or account-specific limits in a CRM or CPQ tool.
A billing integration carries those negotiated terms into the systems responsible for charging and provisioning the customer. Effective dates and pricing versions matter here, especially when a contract changes mid-billing period.
These integrations move financial records into systems used for accounting, reconciliation, and reporting.
Common records include invoices, payments, refunds, credits, and adjustments.
They usually do not need the same response time as a product-facing integration. Accuracy matters more. A delayed accounting update can be reconciled later. A duplicated refund or missing credit creates a much harder financial cleanup.
Billing data becomes much more useful when it is joined with product usage data.
An AI company might combine revenue data with:
That makes it possible to see whether a $5,000 account is actually profitable, which models are driving cost, or where customers consistently burn through their allowance.
For AI products, that analysis often tells you more than billing totals alone.
Selling through a cloud or software marketplace adds another system of record to the stack. The marketplace may have its own customer IDs, usage-reporting requirements, contracts, and settlement process.
Identity gets messy quickly. One enterprise account can have a marketplace identifier, an internal account ID, a CRM record, and a separate billing customer ID. Those records need to resolve to the same customer before usage, payments, and entitlements can stay aligned.
What changes between these integrations is the tolerance for delay and failure. A warehouse sync might recover minutes later without consequence, whereas a credit or entitlement update can affect an AI request already waiting to run.
Billing integrations usually rely on more than one connection method. A native integration might handle the standard flow, while webhooks push state changes and APIs handle edge cases that require custom logic.
Most teams start simple, then add structure as the edge cases pile up. A webhook may be enough at first, until retries, duplicate events, or outages start causing state drift.
APIs and queues give you more control over those failures, which is why mature billing stacks usually use more than one integration pattern.
AI billing gets more interesting once money and product behavior start changing each other in real time. Instead of one clean handoff from product to billing, you end up with two connected flows that have to stay in sync.
Commercial state → product state
Customer → checkout or billing provider → payment_succeeded → billing integration → credit or entitlement state → usage runtime → AI request
A payment might grant credits, but an upgrade can grant access to a model or raise a usage limit.
Product usage → commercial state
AI request → usage event → metering → billing → invoice or reporting
The product creates the usage. An agent runs, credits are consumed, the balance changes, and any overage may become billable.
Both flows can hit the same account within seconds. A customer might buy more credits while several agents are still running, or downgrade while usage events are still arriving.
The integration must keep the commercial and product states aligned across overlaps without double-counting, stale balances, or conflicting updates.
The easiest way to understand billing integrations is to look at where state can drift. In AI products, interesting cases usually involve money changing in one system while credits, limits, or entitlements change in another.
A customer buys 10,000 AI credits. The payment clears, the grant is created, the wallet updates, and the ledger records the source of that balance.
Payment → grant → wallet → ledger
The important boundary is between the financial transaction and the product grant. The ledger should make it possible to trace those 10,000 credits back to the purchase that created them and to explain every subsequent debit or adjustment to that balance.
Top-ups are one of those features that look easy in a product spec and get interesting fast in production.
Suppose an agent burns through the last few credits while several requests are running concurrently. Two requests may see the balance below the threshold at nearly the same time. If both trigger a purchase, the customer gets charged twice.
The system needs a reliable way to coordinate the top-up, confirm payment, create the grant once, and cleanly recover if any step fails midway.
An enterprise contract might include 1 million credits per year, but very few companies want every team drawing from a single, unrestricted pool.
Engineering may get 400,000 credits, while support gets 300,000 and sales gets 200,000. The remaining 100,000 stay at the organization level.
Now the integration is doing more than just provision a balance. It has to translate a commercial agreement into a hierarchy of grants and limits while preserving the underlying account-level commitment. This is where tenancy design begins to directly affect billing architecture.
Refunds quickly reveal whether your billing integration can correctly handle changes in credit state.
Say a customer buys credits, uses 60% of them, and then receives a partial refund. The system needs to determine how many credits to revoke, which grant to adjust, and how to preserve the original purchase and usage history.
A safer approach is to record the refund as a new adjustment or revocation in the ledger. You keep a clear history of the original grant, what the customer consumed, and what changed after the refund.
This is the one I would test early.
A customer upgrades while three agents are still running. The new plan includes more credits, higher limits, and access to a premium model. Billing may also need to prorate the plan change.
Several clocks are now running at once:
Mid-cycle changes expose weak boundaries quickly because billing state, entitlement state, and active usage can all change within seconds of each other.
What these flows have in common is overlap. Payments, credits, entitlements, and active usage can all change within the same window, so the integration must maintain a coherent account state while those updates are in flight.
A surprising number of integration bugs start with two systems believing they own the same piece of state. The code can be working exactly as written while Stripe, your product catalog, and your internal database all disagree about which value is current.
A clean billing integration starts by assigning one source of truth to each state:
Bidirectional writes make that ownership boundary much harder to preserve. If two systems can independently update the same balance, entitlement, or contract state, retries and delayed events can turn a small sync issue into conflicting records.
A safer pattern is to let one system own each state and have the rest subscribe to, reference, or react to changes in that state. That makes failures easier to reason about and gives engineering teams a clear answer when two systems disagree.
A billing integration can fail when events are duplicated, delayed, lost, processed out of order, or applied to the wrong customer or state.
In billing, those familiar distributed-systems problems have very concrete consequences: duplicate credits, blocked paying customers, incorrect entitlements, and financial records that quietly drift away from what the product believes to be true.
Webhook retries are normal. If the same payment_succeeded event arrives twice, the handler should still create one credit grant, one entitlement update, and one ledger entry.
That is why idempotency has to be designed into the flow from the start. Relying on a handler to "probably only run once" is how duplicate credits and double-applied plan changes happen.
A refund can arrive while the original purchase is still processing. A downgrade event can land before an earlier upgrade finishes propagating.
Once that happens, the arrival order can no longer be treated as a business order. Versioned state, timestamps, and reconciliation logic give the system enough context to work out what should actually be true.
Missing events are easy to overlook because the billing provider can look perfectly healthy while your product state falls behind.
A payment succeeded, but your webhook endpoint is unavailable. The provider records the transaction, while your application never receives the event needed to update access, credits, or account state.
Retries cover short interruptions. Durable event storage and replay give you a reliable recovery path when outages last longer or delivery repeatedly fails.
A single customer may exist as:
We have seen integrations go surprisingly far before anyone clearly defines how those identities map to each other. Once that mapping is ambiguous, usage, refunds, credits, and entitlements can be applied to the wrong account, even when every individual API call succeeds.
These are usually the incidents that hurt the most.
Payment succeeds → credit grant fails
Now the customer has paid, but the product still blocks them.
The integration needs to know how to retry safely, where failed events go, how an operator can inspect them, and how state gets reconciled later. Dead-letter handling and observability matter because some failures will need a human to understand what happened.
Billing says Enterprise. The product says Pro. The CRM contains a custom contract.
Nobody necessarily made a bad update. One event may have failed months ago, and the systems moved on.
That is why mature billing integrations do not rely solely on event delivery. Periodic reconciliation compares the relevant states and surfaces disagreements before a customer finds them first.
Webhooks are useful for fast notification, but their delivery semantics are exactly why the failure modes above exist. Duplicate delivery, delayed events, and downstream failures all have to be handled outside the webhook itself.
Duplicate and out-of-order deliveries are normal problems in event-driven systems. Google Cloud Pub/Sub uses at-least-once delivery by default and does not guarantee ordering unless explicitly configured.
That distinction matters more than it sounds. A webhook endpoint returning 200 OK only proves that the request reached your handler. It says nothing about whether the credit grant was written, the entitlement changed, or the downstream service accepted the update.
For production billing, webhook handling usually needs:
Once access to money or products depends on the event, treating webhook processing as durable infrastructure no longer feels excessive.
A slight delay is often harmless on the financial side of the stack. A payment lands at 10:00, the CRM catches up at 10:01, and accounting syncs at 10:05. Nobody loses anything because the general ledger was four minutes behind.
But an AI workload can behave very differently in those same four minutes.
An agent may issue hundreds of model calls, invoke paid APIs, spin up compute, or trigger other agents while its credit balance or entitlement state is stale. By the time the financial systems catch up, the infrastructure cost has already been incurred.
That is why AI products usually need to separate two timing requirements:
The closer a state change gets to product execution, the less tolerance there is for stale data.
These two layers often exchange the same commercial data, but they solve different problems.
A missed billing update can often be reconciled later. Runtime enforcement must return a decision for the request arriving now, which places the two layers under very different timing requirements.
Most production AI architectures need both layers, with a clear boundary between them.
Before shipping a billing integration, I would want clear answers to six questions:
A reliable integration is one you can recover, replay, inspect, and explain after something goes wrong.
A custom integration can be the right answer for a long time. If you have one billing provider, a small number of workflows, and product-specific logic, owning the integration gives engineering direct control.
The trade-off changes as the stack becomes more complex. You may start dealing with:
That is usually where native integrations become more useful.
Engineering teams can build all of this. The better question is which parts are strategic enough to keep owning and which parts have become infrastructure you would rather stop maintaining.
Your billing provider can keep handling the financial side. Stigg sits alongside it as the usage runtime, managing the product-facing state that must remain accurate during AI usage. That includes:
Billing keeps the financial record. Stigg keeps credits, entitlements, limits, and spend governance in sync with what the product is allowed to do. The Stigg docs show how these billing integrations and runtime checks fit together in practice.
Yes. One customer can connect to multiple billing providers during migrations or when different products use separate billing systems. A stable internal customer ID should map each provider back to the same account so credits, entitlements, and billing state stay aligned.
Billing integrations should pin to a specific API version and treat upgrades as planned migrations. Test new payloads, deprecated fields, and webhook schemas before switching versions in production.
Billing integrations may need PCI compliance, but it depends on how payment data flows through your infrastructure.
Raw card data increases PCI compliance requirements, while tokenized payment methods from a payment processor keep most sensitive payment data out of your systems entirely.
Test billing integrations in a sandbox or test environment, including failure scenarios as well as successful payments. Simulate duplicate webhooks, delayed events, declined payments, out-of-order delivery, timeouts, refunds, and partial failures before production traffic depends on the integration.
To migrate a billing integration without interrupting active customers, run the old and new integrations in parallel during the migration and compare their outputs before switching traffic.
Dual-writing or shadowing events can surface differences in invoices, credits, entitlements, and customer state while the existing system remains authoritative.