Skip to main content
Celo Sepolia is a test network, so you can run a complete payment, from request to settlement, without spending real money. This guide takes you from an empty wallet to a settled test payment.

Network settings

The token’s details, as returned by /supported:

1. Check the token is supported

Find the eip155:11142220 entry with x402Version: 2, and confirm the USDC address appears in its supportedAssets.

2. Run a paid endpoint

Follow the Quickstart to run the example server. Use these values in its .env:
AMOUNT is in the token’s smallest unit. USDC has 6 decimals, so 10000 is 0.01 USDC. The price must also be higher than the x402Go fee. Start the server and check that an unpaid request is refused:
You should get 402 Payment Required with the payment request in the response.

3. Create and fund a test wallet

Make a new wallet just for testing. Never use a wallet that holds real funds.
Then get free testnet USDC from the Circle faucet: choose Celo Sepolia and USDC, and enter the address printed above. You don’t need CELO in this wallet. The customer only signs the payment, and x402Go pays the network fee.

4. Run the client

In a separate folder:
Create .env with the key from the previous step:
Create client.ts:
A successful run prints status 200, the paid response, and a settlement receipt that includes the transaction hash.
The spendControls block is required. By default the x402 client only pays tokens it already recognizes, with a $1 cap per payment, and it refuses anything else with a “rejected by spendControls” error. The asset value must match your server’s ASSET. The cap is a safety limit for your wallet, so set it as low as you like.

5. Verify settlement

After a paid request:
  • Check the transaction hash on Celo Sepolia Celoscan.
  • Check your payout wallet. It should have received the payment minus x402Go’s fee.

Troubleshooting

Before mainnet

Move to mainnet only after a test payment succeeds end to end:
  1. Check GET /supported for the mainnet network (eip155:42220) and the token you want.
  2. Update the server’s NETWORK, ASSET, ASSET_NAME, ASSET_VERSION, AMOUNT, and METHOD.
  3. Update the client’s network and token in allowedAssets, with a cap you’re comfortable with.
  4. Confirm your payout wallet in the dashboard, then make one small real payment.