The payment flow
- The client requests a resource.
- The server responds that payment is required and includes the price, who should receive it, and which payment options it accepts.
- The client signs a payment and sends the request again with proof of payment attached.
- The server asks the CDP Facilitator to verify the payment.
- The facilitator returns the verification result.
- The server performs the requested work.
- The server asks the facilitator to settle the payment.
- The facilitator returns the settlement result.
- The server returns the resource and confirms the payment.
Flexible by design
x402 defines the payment handshake without prescribing a single payment rail. Sellers can choose how payment messages travel, where payments settle, which assets they accept, and how they charge:- Transport agnostic. Payment messages can travel over different protocols. These docs focus on HTTP, where payment details travel with the request and response.
- Network agnostic. The same handshake works across chains, including EVM networks and Solana.
- Flexible assets. USDC is the most common asset, but sellers can accept any ERC-20 token on EVM networks or SPL token on Solana.
- Flexible pricing. Sellers can charge a fixed price, authorize a maximum and settle only what was used, or defer settlement for a batch of payments.
What to read next
Pick the path that matches your goal:Seller (SDK)
Charge for your endpoints with x402 and the CDP SDK.
Buyer (SDK)
Pay for an API or resource with x402 and the CDP SDK.
Agentic Accounts
Give your own agent an account it can use to pay for x402 services.
Integrations
Connect x402 to a supported platform where you build and run agents.