This walkthrough assumes you already enabled Coinbase x402 for your workspace facilitator. If you
have not, follow the
<Link href="https://docs.cdp.coinbase.com/x402/quickstart-for-sellers">Coinbase seller quickstart</Link>
first so invoices can be settled.1. Install dependencies
2. Export facilitator credentials
Save your Coinbase keys as environment variables so the SDK can discover them automatically:3. Instantiate the wallet and funded account
402 invoices.
4. Call Horizon with automatic invoice replay
fetchWithPayment helper automatically:
- Performs the initial request.
- Detects a
402 Payment Requiredchallenge. - Signs the invoice with the Coinbase wallet.
- Replays the request with
X-PAYMENT.
5. Poll job status (optional)
Next steps
- Swap Base Sepolia for your production chain when you are ready to process live traffic.
- Combine this wallet flow with the endpoint examples in
/examplesto orchestrate discovery, generation, and extraction pipelines end to end.
