Prepaid credits, topped off automatically.
Sell credit packs, deduct usage from your backend, and let buyers top off automatically when they run out.


- estimated per sale, no monthly fee
- 4.7% + $0.30
- balances kept to two decimal places
- Cents
- credit webhook events
- 6
- auto refill only with buyer consent
- Opt in
See how it works in the dashboard.




import { Pocketsflow } from "pocketsflow";
const pf = new Pocketsflow({ apiKey: process.env.POCKETSFLOW_API_KEY });
// A $20 credit pack. Buyers who opt in are topped off with
// another $20 when their balance hits zero.
const pack = await pf.products.create({
name: "API credits",
price: 20,
productType: "credits",
creditAutoRefill: { enabled: true, topOffCents: 2000 },
});
const session = await pf.checkout.create({
productId: pack._id,
successUrl: "https://example.com/app",
});
redirect(session.url);Usage billing in three calls.
Sell a credit pack, deduct usage in cents from your backend, and stay in sync with signed credit events.
Every resource is an HTTPS endpoint under one base URL with Bearer API keys. Live and test keys are scoped to their own data; the OpenAPI spec is served at /docs.json.
Common questions.
How do credits work?
A Credits product grants a prepaid balance worth its price when someone buys it. Your app spends that balance by calling POST /credits/deduct with the buyer's account id, an amount in cents and an optional reason.
What is auto refill?
If you set a top off amount, buyers can opt in at checkout. When their balance hits zero, their saved card is charged once for the top off and the balance is credited, so usage carries on.
What happens if a refill fails?
The balance is paused and the buyer gets an email. No further charges are attempted automatically; the buyer can fix payment and retry once from their balance page.
Can buyers turn auto refill off?
Yes, any time, from the balance link in their receipt. Changing settings asks for their receipt email first, so a shared link cannot change consent.
How does my app know the balance?
Every deduct returns the new balance, you can list accounts with the API, and signed webhooks fire on credit.granted, credit.balance_changed, credit.auto_refill.succeeded, credit.auto_refill.failed and consent changes.
Can my AI deduct credits?
Deducting is a backend call from your app with an API key. Your AI can create the credit product, set prices, add webhooks and read orders through the MCP server.
What does it cost?
No monthly fee and no setup fee. Each sale carries one itemized transaction cost, 4.7% + $0.30 estimated (about $5.00 on a $100 sale), covering the platform, payment infrastructure, tax handling and dispute prevention. Selling $50,000 or more a month? The Volume plans lower the platform fee to 1% or 0.5%.
Who handles sales tax and VAT?
Pocketsflow is the Merchant of Record. By default it calculates, collects and remits eligible sales tax and VAT on every sale, handles fraud checks and chargebacks, and sends the buyer an invoice. You can also choose to remit tax yourself in Settings, Taxes.
Can my AI do this for me?
Yes. Add the Pocketsflow MCP server to Claude, ChatGPT, Codex, Grok, Cursor or any MCP client, sign in and click Allow access. No API key. Your AI can then create products, set prices and discounts, open checkouts, read orders and send emails, and every change shows up in your dashboard.