How to Build a Billing Infrastructure With Schematic
Learn how to build a billing infrastructure in eight steps. Discover how Schematic's platform can help you with a complete billing infrastructure.

On this page
- Overview
- TL;DR
- Build vs. Buy for Billing Infrastructure: When Does Each Option Fit?
- When to Build a Billing Infrastructure
- When to Buy a Billing Infrastructure
- Top Reasons to Choose Schematic as Your Billing Infrastructure Platform
- A Step-by-Step Guide to Building a Billing Infrastructure With Schematic
- 1. Sign Up for a Schematic Account
- 2. Connect Your AI Agent to Schematic (Optional)
- 3. Create API Keys
- 4. Add a New Feature
- 5. Entitle the Feature to a Plan
- 6. Meter Usage
- 7. Drop Billing Components
- 8. Instrument Your App
- Common Mistakes to Avoid When Building Your Billing Infrastructure
- Inaccurate Usage Tracking
- Disconnected Systems
- Missing Runtime Limit Enforcement
- Lack of Real-Time Usage Visibility
- Insufficient Testing
- Schematic Offers a Complete Billing Infrastructure
- FAQs About How to Build a Billing Infrastructure
- How to build a billing system?
- What are the three types of billing?
- What are the top five billing software options?
Many software and AI companies know how to build a billing infrastructure when pricing is simple. They only need to create a few subscription plans, connect to Stripe for payment processing, build database tables for subscription management, and use middleware for access control.
However, after a few product launches, this setup becomes harder to maintain. New pricing models, usage limits, prepaid credits, and custom plans require frequent changes. Each update requires more code, new billing logic, and engineering time.
For companies without extensive engineering resources, buying a billing platform, such as Schematic, offers an easier path.
You can connect the platform to your product and configure billing without building and maintaining every component from scratch. Engineering can focus on core product development.
This guide walks you through the steps of setting up billing with Schematic. But first, we’ll explain when to build or buy a billing infrastructure.
TL;DR
To build a billing infrastructure with Schematic, you should create an account, connect your AI agent, create API keys, add a new feature, entitle that feature to a plan, meter usage, drop billing components, and instrument your app.
Building that infrastructure from scratch only makes sense for companies with unique billing needs and extensive engineering resources.
Many businesses consider buying a billing infrastructure to launch pricing changes faster and reduce ongoing maintenance.
Schematic offers a complete usage-based billing solution for software and AI companies that prefer to buy rather than build billing infrastructure from scratch.
Build vs. Buy for Billing Infrastructure: When Does Each Option Fit?
Early-stage companies often build their billing infrastructure in-house because pricing remains simple. However, many growing businesses struggle with billing complexity. Frequent pricing changes start to affect product launches, enterprise deals, and daily workflows.
Building gives teams more control, while buying reduces development work. The right choice depends on your billing needs, engineering resources, and long-term plans.
When to Build a Billing Infrastructure
Building your own infrastructure from scratch makes sense when your product has unique billing requirements that existing tools cannot support.
These may include custom billing for enterprise contracts, account-specific rates, or charges tied to specialized AI tasks.
Building your own billing system in-house also makes sense when you want to:
Control how usage, credits, and charges are calculated.
Store billing records in your own databases.
Change pricing and billing behavior without depending on vendors.
Connect billing directly to your product's internal systems.
The downside is that developers should handle development, testing, security, and ongoing maintenance.
Building a billing infrastructure suits large companies with extensive engineering resources and billing experts.
When to Buy a Billing Infrastructure
Buying makes sense when you want to launch new pricing models and iterate on monetization without building every billing component yourself.
According to Growth Unhinged, there were more than 1,800 pricing changes in 2025. Frequent pricing updates emphasize the importance of flexible billing systems.
A dedicated billing platform can handle usage metering, credit management, subscription management, invoicing, payment processing, and entitlement enforcement.
You should buy a billing solution when you want to:
Launch subscription, usage-based, or credit-based pricing faster.
Reduce the engineering work needed to maintain billing systems.
Support new pricing plans without frequent code changes.
Give customers access to usage dashboards and spending controls.
Before choosing a provider, check its pricing flexibility, APIs, SDKs, and integration capabilities.
Engineering still needs to connect the billing platform to your product, but they can spend more time developing features or resolving technical bugs.
Top Reasons to Choose Schematic as Your Billing Infrastructure Platform
If you’ve decided to buy a billing infrastructure, Schematic helps you set up billing without building every component yourself.
Here’s why it is a strong choice for software and AI companies selling to enterprise customers:
Complete billing platform: Metering, credits, software entitlements, billing, and usage governance controls live on a real-time ledger.
Runtime entitlement enforcement: Enforce usage limits for each company, user, or agent.
Enterprise credit wallets: Record every grant, rollover, expiry, and burn-down while giving customers real-time visibility into their prepaid balances.
Flexible price modeling: Implement multiple pricing models through configuration. Ship usage-based, credit burn-down, and hybrid pricing models without engineering time.
Out-of-the-box billing tools: Version plans, migrate customers, and support ASC 606- compliant revenue recognition.
Drop-in billing components: Add pricing tables, checkout, usage dashboards, and invoice history to your application. Style and configure them to match your brand.
Support for sales-led or self-serve motions: Create custom plans and set contract terms, or let customers purchase add-ons, set spending caps, and manage subscriptions themselves.
Max Ade, the co-founder and CEO of Pickleheads, shares, “Schematic lets us change plans in one place and cascade updates to everyone, migrate customers between plans, and run pricing experiments without any manual implementation.”
Book a demo to see Schematic in action!
A Step-by-Step Guide to Building a Billing Infrastructure With Schematic
Follow the steps below to set up a flexible billing infrastructure with Schematic.
1. Sign Up for a Schematic Account
The first step involves creating a free account in Schematic. You can sign up with Google, GitHub, or your email address.
Answer the questions about your company to complete the registration process and reach the dashboard track.

This is where you create plans that your billing engine runs on. Access the Schematic app in your browser to manage billing and pricing logic. You no longer need a code editor, a terminal, or help from an engineer.
Next, load the sample data so you have a starting point instead of an empty dashboard.
Open the Quickstart page in your account.
Click Generate Sample Data.
Review the demo customer, sample plan, and features.
The sample data gives you something to work with as you learn how Schematic works. You can delete them after completing the quickstart.
2. Connect Your AI Agent to Schematic (Optional)
If you use ChatGPT, Claude, or your own AI assistant, connect it to Schematic's model context protocol (MCP) server.
You can choose to work with AI (for chat assistants) or build with AI (for coding assistants). Select the environment you want to build in and grant read-and-write access to the entire system.
Once the agent has been connected, open Schematic’s Quickstart page and copy the onboarding kickoff prompt. Paste the prompt into your assistant to begin.
Alternatively, you can send your pricing rules when they already exist somewhere. This eliminates the need to describe them using your own words.
3. Create API Keys
Your application uses API keys to communicate with Schematic. Create them before your engineers begin instrumenting your app so they have all the necessary credentials.
Follow these steps in the dashboard:
Open Settings by clicking the gear icon.
Select API Keys, then click Create.
Give the key a recognizable name, such as “Quickstart.”
Create the key and send both credentials to engineers who will integrate your app.

Store the secret key immediately. Schematic displays it only once. If you lose it, create a replacement and delete the old key.
4. Add a New Feature
A feature inside Schematic is a product capability that you want to sell, gate, or limit.
You need to create a new feature to monetize it. Here's how to do it:
Go to the left navigation and select Features.
Click Create and enter a descriptive name, such as "Financial reporting."
Choose Boolean as the feature type. A boolean feature is either on or off and determines whether a company has access to that capability or not.
Under the Flag section, enter a flag key, such as financial-reporting.
Click Create feature.

Your application will use that flag key when checking access for a specific feature. Agree on the name with your engineers before saving it.
5. Entitle the Feature to a Plan
After creating the feature, you can access that feature's page. Entitling that feature to a plan gives companies access to it as long as they are subscribed to the right customer plan.
Below is a step-by-step guide:
Open the Entitlements tab.
Choose an existing plan you want to give feature access, or click Add plan entitlement.
Attached is an example of an existing feature, Video Generation, entitled to several plans. Here's what the feature tab should look like after adding a plan.

Next, navigate to the Monetization Settings panel and switch the boolean feature On for that plan.
Click Save changes.
Schematic applies the changes immediately without deploying code or filing an engineering ticket.
6. Meter Usage
If you want to implement usage-based pricing and bill customers for actual consumption, you need to track raw usage data and convert it to accurate invoices.
Fortunately, metering and billing are easy to handle inside Schematic. All you need to do is create an event-based feature, set usage allowances on a plan, and confirm that usage data is arriving.
Follow these instructions when creating an event-based feature.
Open the Features tab on the left navigation.
Click Create, enter a name, and set the type to Event-based.
Scroll down to Flag and enter the flag key.
Under Event, determine the event your application will report every time a customer uses the feature.
Select Create feature to apply the changes.

After creating an event-based feature, decide how much usage the plan includes. Here's how:
Under Entitlements, select a plan you want to give access to. Or you can click Add plan entitlement.
Open the Monetization Settings panel, where you can set the Type to Numerical.
Enter a Value, such as 50, to specify how many usage events a company can use.
Under Define reset, choose between "Daily," "Weekly," or "Monthly." This allows the usage allowance to reset according to the billing period.
Click Save changes.
7. Drop Billing Components
Schematic provides React billing components that you can quickly drop into your app. Engineering no longer builds everything from scratch.
Start with a customer-facing portal that allows users to view their current plan and usage. It also lets customers upgrade or choose from multiple payment methods without needing to email your support team.
Follow these simple steps to create the portal:
Navigate to Components on the left side of the dashboard.
Click Create Component.
Enter a name, such as "Customer Portal."
Choose the Customer Portal template and click Create.
The portal automatically reflects previously configured plans, features, and usage allowances.
You can select from different templates depending on your needs. The template library includes pricing tables, checkout flows, credit usage, invoices, and an unsubscribe button.
Don't forget to send the component ID to your engineers because they will use it to place the portal inside your app. Simply open the three-dot menu and copy the component ID.
8. Instrument Your App
The final step involves integrating Schematic into your application so it can identify customer segments, evaluate access, and report usage. This is done by your engineers.
Make sure your company has a Schematic account, a publishable key, and at least one feature with a flag key.
Connect the MCP server if you haven't done it yet.
Complete the integration by following these steps:
Install and mount the SDK.
Identify the active company and user using your existing account IDs.
Check entitlements to determine whether a company has access to a feature or not.
For metered features, send usage events and report on each one.
Configure a billing component inside Schematic's dashboard and use a temporary access token for rendering.
Verify that everything works by checking the Companies and Events tabs.
Common Mistakes to Avoid When Building Your Billing Infrastructure
Building your own billing system from scratch comes with risks. Here are five common mistakes that can cause billing errors, lower recurring revenue, and hurt customer trust.
Inaccurate Usage Tracking
Usage events can be lost, delayed, or counted twice when several services send billing data. These errors lead to undercharges, overcharges, and customer disputes.
Give every usage event a unique ID. Then, make sure to store its customer, metric, quantity, and timestamp. Use idempotency checks to reject duplicates and event queues to retry failed deliveries.
Compare metered usage data with application logs before closing each billing cycle. Keep the original events so your team can trace charges back to specific customer activities.
Disconnected Systems
When metering engines, invoice generation tools, payment processors, and accounting systems store separate customer records, billing errors become harder to detect.
For example, a paid invoice may still appear overdue, or a refund may never reach your finance team.
Assign a single source of truth for all billing and financial data. Connect your services through APIs or event queues. Then, use the same customer and invoice IDs in every system.
Reconcile billed usage, invoice records, existing contracts, payment data, credits, and refunds regularly. Log failed data transfers and retry them safely to keep records consistent even when services fail.
Missing Runtime Limit Enforcement
Tracking usage is not enough if your billing engine cannot stop customers from exceeding their limits.
Without runtime entitlement enforcement, customers may continue making API calls or consuming AI tokens after reaching their allowances. This can lead to surprise bills.
Add entitlement checks when processing requests. Your application should evaluate the customer's active plan, remaining quota, and credit balance before approving usage.
Set hard limits to block requests or enable soft limits to bill extra consumption as overages.
Lack of Real-Time Usage Visibility
Traditional billing systems do not give customers real-time visibility into their consumption.
When buyers only see their invoice at the end of the billing period, they are more likely to file disputes because of unexpected charges.
Build a customer dashboard that displays live consumption, remaining prepaid credits, estimated charges, and spending limits.
Update these values as new usage events are processed. Send alerts when customers approach their allowances or spending thresholds.
Give customers access to detailed usage records so they can understand their charges without waiting for the invoice to arrive.
Your support team should also have access to this information to answer billing questions quickly.
Insufficient Testing
Your billing platform may work during normal transactions but fail when customers change plans, request refunds, or exceed usage limits.
Test subscription upgrades, cancellations, duplicate events, credit deductions, and payment retries.
You should also simulate service outages, delayed webhooks, and simultaneous requests to detect billing errors.
Run thorough tests before launching new pricing tiers and monitor billing activity after each release.
Schematic Offers a Complete Billing Infrastructure

Schematic is the best usage-based billing platform for software and AI companies that prefer to buy, not build, their billing infrastructure.
Schematic combines usage metering, entitlements, credit wallets, and usage governance on a real-time ledger. Meter everything once to power invoices, access decisions, and analytics.
Rahul Gill from Macabacus says, "We didn't want to burden our engineering team with building and managing a metering system, and Schematic solved that for us."
The same credit ledger stores pricing as data. That means updating plans can happen through configuration instead of code deployment.
Unlike traditional billing systems, Schematic gives enterprise customers real-time visibility into usage, spend forecasts, self-service controls, and configurable spending limits. Native credit wallets prevent runaway bills and unexpected access throttling by showing remaining balances.

Plus, AI billing tools enable teams to launch usage-based pricing, grant credits, version plans, migrate customers, and test pricing before rolling it out to the entire customer base.
The people closest to the customer relationship (sales reps, product managers, and RevOps) can make pricing changes without filing an engineering ticket.
FAQs About How to Build a Billing Infrastructure
How to build a billing system?
The process starts with defining your pricing model and billing requirements. Build a product catalog, a usage metering system, a rating engine, credit wallets, and an entitlement system. Then, connect your billing infrastructure to your existing tech stack. Test all billing workflows before launching your system.
What are the three types of billing?
The three common billing types for software and AI companies are subscription (recurring billing), usage-based billing, and hybrid billing. Subscription billing charges recurring fees, while usage-based billing is where companies charge customers for actual consumption. A hybrid approach combines fixed subscriptions with variable usage-based fees.
What are the top five billing software options?
Popular billing solutions include Schematic, Metronome, Chargebee, Orb, and Lago. Schematic is a strong choice for software and AI companies that sell usage-based plans to enterprises. It combines usage metering, credit wallets, runtime entitlements, and spending controls in one platform.


