The two paths
Usage flows down one of two paths. The difference is when money settles.| Dollar billing | Credit billing | |
|---|---|---|
| When you charge | At invoice time — usage adds up, you bill later | At usage time — credits come off a balance instantly |
| The result | An invoice, auto-charged to a card | A balance that goes down and refills or tops up |
| Feels like | A monthly bill | A prepaid wallet or an allowance |
| Classic for | API metering | AI products, packs, plan allowances |
The two verbs
At runtime your app only ever does two things: it checks whether a customer is allowed to do something, and it tracks that they did it.check — before the action
Ask UnitPay whether the customer has access before you do the work.
Response
access is false when the customer is out of balance or the feature isn’t in their plan. In your UI, the React SDK does the same check synchronously — see React SDK.check never changes state — it’s a read. track is the write that moves money or credits. Track from your server with a secret key so usage can’t be spoofed from the browser.The objects you’ll use
Customer
Whoever you bill. Their id is your own user or org id — no extra id to store.
Plan
What a customer subscribes to: a price, entitlements, and credit grants.
Entitlement / feature
What a plan grants access to — what
check reads.Credit account & ledger
A customer’s wallet and the append-only record behind its balance.
Grant
One deposit of credits — from a plan, a drip, a promo, or a package.
Invoice
The dollar bill, auto-charged to a card at settlement.
Next steps
Quickstart
Set up a catalog, subscribe a customer, and watch credits burn — end to end.
Credits
The credit path in depth: grants, denominations, wallets, and top-ups.
Authentication
API keys, and the difference between sandbox and live.
Billing
Plans, subscriptions, payments, and invoices on the dollar side.