For AI coding agents
If you build your integration with an AI coding assistant — Claude Code, Cursor, Copilot or similar — give it the agent handbook: markdown files with the complete contract of this checkout layer, written to be read by a model.
The files
| File | What it holds |
|---|---|
/agents.md | The entry: the rules that decide money, the credentials, the routes and the sequences, with a link to each chapter |
/agents/intents-subscriptions.md | Payment Intents and subscriptions — every field, response and error of the server API |
/agents/widget-sdk.md | The JavaScript SDK and the embedded widget — mount options, the handle, callbacks, the postMessage protocol, 3-D Secure and wallets |
/agents/webhooks-transactions.md | Webhooks, transactions and disputes — the signed request, the full payload, statuses, a correct handler |
/agents/hosted-products.md | Hosted checkout pages, products and coupons, hosted invoices with bank and USDC pay-ins |
/agents-full.md | Everything above joined in one file |
Give the assistant the entry plus the chapters for the parts you build, or the single /agents-full.md when it should know everything.
Why a separate file
These pages explain. The handbook instructs. It states each rule once, in imperative form, with the exact field names, status codes, error codes and decision tables an agent needs to write correct code — and, above all, the rules about uncertain outcomes (status: "pending", processing, pending_activation) and server-side confirmation, which a model will otherwise get wrong by trusting the browser's success message.
It is self-contained: an agent that has only the handbook can build a correct integration against the Payment Intents API, the JavaScript SDK or the raw embedded widget, including recurring payments and webhooks, and can set up hosted product checkout correctly.
How to use it
Download
/agents-full.md, or/agents.mdand the chapters you need.Put it in your repository where your assistant reads project instructions, for example
docs/securepayapi.md, and reference it from yourCLAUDE.md,AGENTS.mdor.cursorrules:markdownPayments: follow docs/securepayapi.md exactly. Never deviate from its "Invariants" section, and never mark an order paid without the server-side GET /api/v1/payment-intents/{id} check it describes.Ask for the integration in the handbook's terms — for example "implement the flow from docs/securepayapi.md: the backend creates the intent, the page mounts the SDK in external submit mode, the backend confirms the intent before placing the order".
Review what the agent writes against the handbook's pre-launch checklist before going live.
What it contains
- The credentials and identifiers, and where each may appear
POST /api/v1/payment-intents— every field, limit, response and error code, including thesubscriptionobject for recurring paymentsGET /api/v1/payment-intents/{id}— the confirmation step and its decision tablePOST /api/v1/payment-intents/{id}— setting your reference on an unpaid intent- Subscription plans and agreements: plans, variable cycles, cancel / pause / resume, and what each answer means
- The JavaScript SDK: options, the handle (
submit,validate), the result payload, external submit, wallets, domains - The raw embedded-widget
postMessageprotocol - Webhooks: setup, payload, signature verification, retries, coalescing, the status table, subscription events
- The transaction lookup
- Hosted checkout pages: what the URL may carry, products and coupons with the limits the checkout actually enforces, and how a hosted payment reaches you
- Hosted invoices with bank (ACH, wire) and USDC pay-ins: what the customer sees, the statuses, and what must not be taken as payment
- Sandbox, test cards and the scenarios to pass
- Retry and idempotency rules per endpoint, and a pre-launch checklist
The handbook covers the checkout layer only — where card data never touches your systems. Merchants integrating with the processing API directly (sending card data themselves, PCI DSS scope) use the separate handbook in the direct-integration section.
Hosted invoice Bank Pay-ins and USDC pay-ins are covered in the hosted-products chapter as the customer and merchant see them. They are separate from Payment Intents and SDK payment methods; creating invoices and reading their bank or USDC state from your server uses the private direct-integration contract.