The two paths
Usage flows down one of two paths. The difference is when money settles.
You don’t pick one for your whole business. You choose per plan, and a single plan can do both — a dollar price for the subscription and a credit grant that refills every cycle.
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.1
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.2
track — after the action
Report what happened. UnitPay routes the event by how the plan is priced: it deducts credits, meters usage for a dollar invoice, or both.
Response
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.