Pocketsflow

Prepaid credits, topped off automatically.

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

You can use your current AI to sell credit packs for your app.

Sign in, click Allow. No API key.
Product editor for Captionly AI credits ($25) with product type Credits, credit auto-refill enabled, a $25 top-off amount and a $25 credit pack amount, beside a product page previewProduct editor for Captionly AI credits ($25) with product type Credits, credit auto-refill enabled, a $25 top-off amount and a $25 credit pack amount, beside a product page preview
Credits is a product typeSet the pack amount and, if you like, an auto refill top off.
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.

Buyer credit balance page: $18.40 balance, Active, saved card on file, last top-off September 19, receipt email confirmation and the auto-refill switch turned on
A balance page for every buyerBuyers check their balance, their saved card and turn auto refill on or off.
Checkout for Captionly AI credits ($25) with a checkbox to top off the balance automatically ($25.00) with the saved card, and an order summary with tax, total $27.06 and a Pay button
Buyers opt in at checkoutThe top off amount is shown before they pay, with a clear consent line.
Developers, Webhooks: three enabled endpoints (captionly.app, framekit.app and hooks.northlight.studio) with the number of events and created dateDevelopers, Webhooks: three enabled endpoints (captionly.app, framekit.app and hooks.northlight.studio) with the number of events and created date
Every balance change, as an eventcredit.granted, credit.balance_changed, auto refill succeeded or failed, consent on or off.
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.

npm install pocketsflow

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.

Start selling today.

Sell your first product in minutes.