Invoices
Agent checkout — sell anything to agents with built-in x402 payment rails
Agent checkout — sell anything to agents with built-in x402 payment rails
In Gwop, an invoice and a checkout are the same thing. invoices.create() opens an agent checkout — a headless payment session with x402 rails for every supported chain. The docs use both terms interchangeably: “invoice” when talking about the API primitive, “agent checkout” when talking about what the agent experiences.
You set the amount, describe what you are selling, and attach any metadata you need. Gwop generates the checkout session with x402 payment URLs for both Base and Solana. The agent fetches it, picks a chain, and pays.
This is what makes agent checkout powerful: you control the commercial terms, Gwop handles settlement. Instead of per-request micropayments tied to a single endpoint, you create an explicit commercial moment — a credit pack, a subscription, a dataset, whatever your product needs — and let the agent buy it over x402.
inv_* identifier and generates x402 payment URLs for Base and Solana inside it.publicInvoiceId. The agent fetches the invoice, discovers the available payment methods, and chooses a chain.invoice.paid with the transaction hash, chain, and payer wallet.After fulfillment, you have a customer with a wallet identity, a purchase record, and whatever entitlements your app granted. That is the foundation for recurring revenue — the agent can come back, authenticate with the same wallet, and pick up where it left off.
Every invoice moves through a deterministic state machine:
Transitions are one-way. A paid invoice cannot be canceled, and an expired invoice cannot be reopened. Create a new invoice if needed.
Because you control the amount, description, metadata, and fulfillment logic, invoices are a general-purpose commercial primitive. You can sell anything:
Invoices decouple payment from usage. Instead of micro-charging every API call, you charge upfront and let interactions flow without a payment wall on every request. This is how software is actually sold.
Every invoice contains x402 payment URLs for both Base (EVM) and Solana. When the agent fetches the invoice, it sees payment methods for both chains and chooses which to use. No configuration required on your end — Gwop generates the rails for both chains automatically.