Prompt
How do I track plans, prices, invoices, and subscriptions in one system?
Latest observation
Oct 25, 2026
OpenAI APIWeb search: off
A good way to track plans, prices, invoices, and subscriptions in one system is to use a single billing data model with a few core objects that all connect to each other.
Core entities to store
1) Plans
Represents what you sell.
plan_idnamedescriptionstatus(active, archived)
2) Prices
Represents how a plan is charged.
price_idplan_idcurrencybilling_interval(monthly, yearly, one-time)amounttrial_daysor other pricing ruleseffective_from,effective_toif needed
A plan can have multiple prices, for example:
- Basic monthly
- Basic yearly
- Basic promotional price
3) Customers / Accounts
Represents the buyer.
customer_idnameemailbilling_addresspayment_status
4) Subscriptions
Represents an active agreement between a customer and a plan/price.
subscription_idcustomer_idplan_idprice_idstart_daterenewal_datestatus(active, paused, canceled, past_due)quantitydiscount_idif applicable
5) Invoices
Represents what was billed.
invoice_idcustomer_idsubscription_idorbilling_period_idinvoice_datedue_datetotal_amounttax_amountstatus(draft, open, paid, void, overdue)
6) Invoice line items
Represents each charge on an invoice.
invoice_line_idinvoice_idprice_iddescriptionquantityunit_priceamount
This is important because one invoice can include:
- subscription charges
- prorations
- taxes
- one-time fees
- discounts
Recommended relationships
- One Plan has many Prices
- One Customer has many Subscriptions
- One Subscription points to one current Price
- One Subscription generates many Invoices
- One Invoice has many Invoice Line Items
Best practice: separate “catalog” from “billing activity”
Catalog data
Static-ish data:
- Plans
- Prices
Billing activity
Transactional data:
- Subscriptions
- Invoices
- Payments
- Credits
This makes reporting much easier.
Suggested database structure
If you’re building this in a relational database, a simple schema would be:
planspricescustomerssubscriptionsinvoicesinvoice_linespaymentscredits/refundsif needed
Practical workflow
- Define a plan
- Attach one or more prices to it
- Create a subscription for a customer using a chosen price
- Generate invoices on each billing cycle
- Add invoice line items
- Record payments
- Update subscription and invoice statuses
If you want a simple all-in-one app
You can also use:
- Stripe Billing
- Chargebee
- Recurly
- Zoho Subscriptions
- Odoo
- ERPNext
These systems already handle most of this model.
Simple rule of thumb
- Plan = what you offer
- Price = how much it costs
- Subscription = who is paying for it
- Invoice = what you billed
- Invoice line item = the breakdown of charges
If you want, I can also give you:
- a database schema example,
- a JSON/API design, or
- a spreadsheet layout for tracking all of this.