A key per integration
Name a key for each server, script or agent, give it an expiry if you want one, and revoke it on its own. Keys are stored hashed, and a revoked key answers 401 on its next call.


A REST API, a typed SDK and a signed webhook for every event. Open a checkout from your backend, issue license keys, bill by seat or by usage, and let your AI agent do the rest over MCP. We are the merchant of record on every sale, for 2% plus card processing and no monthly fee.


Pocketsflow gives developers a REST API, a typed SDK and a signed webhook for every event: open a checkout from your backend, issue license keys, and bill by seat or by usage. It is the merchant of record, so tax is handled, for 2% a sale plus card processing and no monthly fee.
Test keys never charge a real card, so you can run the whole flow before you go live.
The package is typed and runs on Node and edge runtimes.
npm install pocketsflowIn the dashboard, open Developers → API keys. A pk_test_ key reads and writes test data only; a pk_live_ key, live data.
POCKETSFLOW_API_KEY=pk_test_...Create a session on your server and send the buyer to its url. Tax, fraud checks and the receipt are handled, then order.completed reaches your webhook.
POST /checkout/sessions → 201 { id, url }import { Pocketsflow } from "pocketsflow";
const pf = new Pocketsflow({ apiKey: process.env.POCKETSFLOW_API_KEY });
// Your "Buy" button posts here.
export async function POST(req: Request) {
const { email } = await req.json();
const session = await pf.checkout.create({
productId: "665f1c2a9b3e4a0012ab34cd",
successUrl: "https://example.com/welcome",
cancelUrl: "https://example.com/pricing",
customerEmail: email,
});
// The hosted checkout. Send the buyer there.
return Response.json({ url: session.url });
}Products, checkout, orders, payments, subscribers, discounts, refunds and webhooks are all endpoints. The dashboard and your code read the same data.
pk_test_ is always test data, pk_live_ always live.RateLimit headers; a 429 says when to retry.Name a key for each server, script or agent, give it an expiry if you want one, and revoke it on its own. Keys are stored hashed, and a revoked key answers 401 on its next call.


Subscribe an HTTPS endpoint to any of 50 events. Each delivery is signed with HMAC-SHA256 over a timestamp and the raw body, carries an evt_ id that stays the same on every retry, and lands in a delivery log you can replay from.
X-Pocketsflow-Signature-V2: t=<seconds>,v1=<hex>. Reject anything older than five minutes.5xx, a 429 or a timeout is retried with the same event id: about 10 s, 1 min, then 5 min apart.2xx fast and do the work in the background.import { createHmac, timingSafeEqual } from "node:crypto";
const SECRET = process.env.POCKETSFLOW_WEBHOOK_SECRET!;
export async function POST(req: Request) {
const raw = await req.text(); // the exact bytes, before any parsing
// X-Pocketsflow-Signature-V2: t=<unix seconds>,v1=<hex>
const header = req.headers.get("X-Pocketsflow-Signature-V2") ?? "";
const { t = "", v1 = "" } = Object.fromEntries(
header.split(",").map((part) => part.split("=", 2)),
);
const expected = createHmac("sha256", SECRET)
.update(`${t}.${raw}`)
.digest("hex");
const fresh = Math.abs(Date.now() / 1000 - Number(t)) < 300;
if (!fresh || v1.length !== expected.length ||
!timingSafeEqual(Buffer.from(v1), Buffer.from(expected))) {
return new Response("invalid signature", { status: 400 });
}
const event = JSON.parse(raw); // { id: "evt_…", type, created, … }
if (await alreadyHandled(event.id)) return new Response("ok");
switch (event.type) {
case "order.completed":
await grantAccess(event.customer.email);
break;
case "customer.subscription.deleted":
await revokeAccess(event.customer.email);
break;
}
return new Response("ok");
}Each attempt is recorded with its status and the exact JSON your server received. Re-send one with a click, or with POST /delivered-webhooks/{id}/redeliver.


Switch on license keys for a product and every sale gets its own key, like 7KQ2M-X9D4R-T3VWB-8HNPC. The buyer finds it in the receipt, you find it on the order and in the order.completed webhook, and your software checks it with three public POST endpoints. No API key ships inside your app.
valid: false with a code when the key is off.const PRODUCT_ID = "665f1c2a9b3e4a0012ab34cd";
// Public endpoints: no Authorization header, safe to call from your app.
async function license(
action: "activate" | "validate" | "deactivate",
licenseKey: string,
instanceId: string,
) {
const res = await fetch(`https://api.pocketsflow.com/licenses/${action}`, {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({ productId: PRODUCT_ID, licenseKey, instanceId }),
});
return res.json(); // { valid, status, code, activationsRemaining, … }
}
// When the user enters their key:
const activation = await license("activate", userKey, deviceId);
if (!activation.valid) showError(activation.message);
// On every launch:
const check = await license("validate", savedKey, deviceId);
if (!check.valid) lockApp(check.code); // e.g. "license_disabled"Put seats and up to five meters on a subscription offer, then report usage as it happens. When the period ends we price what went over the included units, charge it once to the card on file and send usage.period_closed with the totals.
Idempotency-Key and a retried report counts once, even when retries race.# 250 API calls for one subscriber, counted once even if retried.
SUB=665f1c2a9b3e4a0012ab9911
curl -X POST https://api.pocketsflow.com/subscriptions/$SUB/usage \
-H "Authorization: Bearer $POCKETSFLOW_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: req_8f2a91" \
-d '{ "meter": "api_calls", "quantity": 250 }'
# 201 Created
# { "usageRecord": { "meter": "api_calls", "quantity": 250, … },
# "period": { "start": "2026-09-28T09:00:00.000Z", … },
# "replayed": false }Usage billing is on every plan, including Free. Selling prepaid credits instead? Deduct from a buyer's balance with POST /credits/deduct.
The MCP server exposes 305 tools over streamable HTTP with OAuth 2.1. Claude, ChatGPT, Cursor, Gemini CLI or an agent you build signs in once, and then creates products, opens checkouts, reads orders and manages webhooks with your permissions. Payment refunds stay in the dashboard.
{
"mcpServers": {
"pocketsflow": { "url": "https://www.pocketsflow.com/mcp" }
}
}MCP: <app>, revocable under Developers → API keys.npx @pocketsflow/mcp and a pk_test_ key.

Pocketsflow is the merchant of record: the legal seller on each order. The parts of payments that are not your product stay with us.
Yes. One REST API covers everything in the dashboard, with a typed SDK (npm install pocketsflow) and a signed webhook for every sale, renewal and refund. The API is on every plan, including Free.
Yes. The key decides the mode: a pk_test_ key only reads and writes test data and never charges a real card, and a pk_live_ key works on live data. Run the whole flow in test mode before you go live.
Switch on license keys for a product and every sale gets its own key, shown in the buyer's receipt, on the order and in the order.completed webhook. Your software checks it with three public endpoints (activate, validate, deactivate), so no API key ships inside your app.
Yes. The MCP server gives Claude, ChatGPT or your own agent 305 tools over the same API, with the same permissions you have. There is no API key to paste: you sign in and click Allow access.
A Merchant of Record (MoR) is the legal seller on each transaction. As your MoR, Pocketsflow handles payment processing, sales tax and VAT, fraud prevention, chargebacks and invoices, so you never set up a merchant account or register for tax abroad.
Free to start, no monthly fee. 2% a sale plus card processing, with tax, fraud and payouts handled.