402 Payment Required / X-PAYMENT retries without touching Stripe sandbox quota or real chain gas.
By use case
These are the workflows agents actually run against this twin, each naming the MCP tools and REST surfaces involved. Anything named here that is not fully modelled says so in place.Create and settle a crypto PaymentIntent
Create a PaymentIntent, drive it throughrequires_action, and settle it with the test-helper deposit tool. MCP: create_payment_intent, confirm_payment_intent, retrieve_payment_intent, simulate_crypto_deposit. REST: POST /v1/payment_intents, GET /v1/payment_intents/:id, POST /v1/payment_intents/:id/confirm, POST /v1/test_helpers/payment_intents/:id/simulate_crypto_deposit.
Reconcile a refund
Issue a refund against a settled charge, then confirm it against the event log and balance. MCP:create_refund, retrieve_refund, list_refunds, retrieve_charge, list_events, retrieve_balance. REST: POST /v1/refunds, GET /v1/refunds/:id, GET /v1/charges/:id, GET /v1/events, GET /v1/balance.
Manage a customer and their payment methods
Create a customer record, attach a payment method to it, and look up what is on file before charging again. MCP:create_customer, retrieve_customer, update_customer, delete_customer, list_customers, create_payment_method, attach_payment_method, detach_payment_method, list_customer_payment_methods. REST: POST /v1/customers, GET /v1/customers/:id, DELETE /v1/customers/:id, GET /v1/customers/:id/payment_methods, POST /v1/payment_methods, POST /v1/payment_methods/:id/attach, POST /v1/payment_methods/:id/detach.
Inspect a subscription and its billing objects
Read products, prices, subscriptions, and invoices. There is no billing engine behind these running real billing-cycle math, and nothing mints an invoice —GET /v1/invoices always returns an empty list. REST: GET /v1/products, GET /v1/prices, GET /v1/subscriptions, GET /v1/subscriptions/:id, GET /v1/invoices, GET /v1/invoices/:id. Every surface named here is shape only — see What you can rely on before you grade on them.
Gate a resource behind x402
Protect a route withpaymentMiddleware(), return a 402 challenge, and accept a retried request carrying an X-PAYMENT header once the agent pays.
Inject a failure and check the retry
Inject a lost-response failure on a refund or PaymentIntent call and confirm the agent retries with the same idempotency key instead of double-charging.What you can rely on
Each surface below carries two rulings that are deliberately kept apart: heat is how deep it should be, ruled per milestone; state is how deep it is today, measured by the twin’s own tests. Neither moves because the other did. A surface is in exactly one state, and the six below are different answers to “can I write a task against this”:@pome-sh/twin-stripe declares 26 MCP tools and 43 REST surfaces, read from the twin’s own fidelity.inventory.json (last updated 2026-07-12):
Shape only
Read these; do not grade on them. The response shape is right and the behaviour behind it is not asserted, so a criterion that checks a value here can pass for the wrong reason.Out of scope
Checkout, Connect, webhook delivery loops, and the rest of the Stripe surface beyond what is listed above are not modelled. These surfaces are named rather than left to the catch-all, so the 501 is documented and test-backed:Known divergence, ruled
19 divergences are on the ledger for Stripe: measured against the real API, found to differ, reviewed, and accepted. Each is registered and reverse-tested, so one that upstream heals becomes a signal rather than a surprise. The numbers are stable identifiers, not positions — a retired divergence leaves its number behind, so a gap in this list is a divergence that closed.Twin-only tool
The twin serves it and the vendor’s published tool list does not declare it. An agent that learns to use it here would be refused in production.Vendor-only tool
The vendor declares it and the twin answersunknown_tool. An agent doing the right thing is marked down for it.
Where it runs. Both doors serve the same twin:
pome twin start stripe boots it as a local process, and pome sandbox create --twin stripe starts a hosted sandbox running the same image. The states above are properties of the twin, so they hold on either.
A further 1 difference between the two tool tables — argument names, descriptions, types — is registered and accepted on tools that exist on both sides. They are reviewed the same way and are not listed here because they change how a tool is called, not whether it is there.
Everything above is what the twin declares. What it was measured to do is a different number: the comparison against real Stripe runs daily and publishes, surface by surface, how many matched, which drifted, and which are ruled exceptions with the reason written out in full — at status.pome.sh/twin/stripe, which also states when it last ran and how old the captured baseline it compares against is. No count is copied onto this page, because copying one is how it goes stale.
Read from FIDELITY.md and fidelity.inventory.json in pome-sh/digital-twins, at the commit .github/twins-ref pins (2e41939).
Quickstart
Point your agent at it
For interactive development without a full task run, start the standalone twin:pome run injects the same three into your agent’s process, pointed at that run’s own sandbox rather than standalone. Hosted sandboxes may instead set POME_STRIPE_API_BASE and POME_STRIPE_API_KEY.
It also accepts Stripe-style API keys. Tasks seed a default test key, sk_test_pome_default. Point a Stripe SDK at the REST URL with that key, or send the JWT as Authorization: Bearer <token> — both resolve to the same sandbox.
POME_STRIPE_REST_URL.
To check whether the twin is alive, use the unauthenticated root health endpoint:
Task seed shape
Stripe task seeds are flat, withapi_keys and the collections a task needs — payment_intents, charges, refunds, balance_transactions — plus failure_injection rules.
Generate it; do not copy it. The block below is what the twin starts with, printed by the CLI from the twin’s own declared state — so it parses against the twin you are about to seed, today and after the twin changes:
twins: ["stripe"] in the task’s ## Config block and name the file <task>.seed.json, beside the task’s .md. That ## Config is the only place the twin gets named: the file above is flat, so it carries no twin id of its own.
Seed file
A task is not the only way in.pome twin start and pome sandbox create take that very same file — no wrapper, no second shape, nothing to convert — and each takes the twin’s name beside it, since the file cannot supply one:
pome twin new-seed stripe slack writes it:
twin start and sandbox create want the name as well, and why a task’s sidecar does not — the ## Config beside it already named the twin. From two twins up the file is a per-twin envelope { <twin>: <seed> }, which does name its twins, though twin start still has to be told which one of them to boot. Replace, not merge, applies wherever the file lands.
Build your own world is that job end to end — generating the file, editing it down, both doors, and how to tell whether every field you wrote actually landed.
Example tasks
Ready-made examples you can run or copy to see the twin in action:Catalog
Run one
pome-suggest-tasks and pome-run-task skills, installed by the graded capstone.