Selling products to people and agents? The
Business Checkouts API creates one
checkout with a hosted payment URL for people and an
x402_url for agents. Use it to support
both payment flows without running your own x402 server or facilitator. See
Accept agentic payments with x402.Charging for an MCP tool instead? Follow Charge over MCP. This
quickstart covers HTTP routes.Prerequisites
- A CDP API key and wallet secret. The API key authenticates your server to the CDP Facilitator; the wallet secret lets the SDK provision the wallet that receives payments.
- Node.js 22 or later.
1. Install the SDKs
The CDP SDK handles the receiving wallet and the facilitator. The x402 packages handle the protocol and the framework middleware.- TypeScript
- Python
2. Price a route
The following servers charge $0.01 forGET /report and receive payments in your CDP wallet.
- TypeScript
- Python
createX402Server does the whole setup in one call: it provisions the receiver wallet,
connects to the CDP Facilitator, registers the payment schemes and extensions, and returns
a compliant x402 server object that any x402 framework adapter accepts.routes is protected; everything else stays free.3. Start the server and confirm x402 is set up
In a new terminal, start the server:- TypeScript
- Python
402 Payment Required response confirms that the route is protected.
4. Test the payment
Choose either testing path:- Ask your agent to use the
Pay for Service skill with
http://localhost:8402/report. - Build a basic client with the buyer quickstart, then point its
request at
http://localhost:8402/report.
HTTP 200.
5. Move to production
After the test payment succeeds, switch the route to a mainnet before accepting real payments:- TypeScript
- Python
networks list switch from Base Sepolia and Solana Devnet to Base
and Solana mainnets.payTo address can receive funds on its mainnet. Dollar prices such as "$0.01"
automatically use the network’s default USDC asset. If you specify a token address and amount
directly, replace any testnet asset address with its mainnet equivalent and verify its decimals.
See Production configuration for custom networks, assets,
receiving wallets, and payment schemes.
Runnable examples
Complete versions of the server cover more frameworks:What to read next
Your endpoint is priced and paid. The next step is making it discoverable.- What settled your payment? CDP Facilitator covers the supported networks, schemes, and pricing.
- Need production networks, another scheme, or a different receiving wallet? See Production configuration.