Polygon facilitators on Amoy and
mainnet run x402 v2. Use the
@x402/*
packages below. For Go or Python server examples, see the
official x402 seller quickstart.Prerequisites
This guide starts with Amoy testnet configuration. See
Running on Polygon mainnet when you are ready for
production.
Install dependencies
Whereverbunis used, replace it withnpmor your preferred package manager.
- Express
- Next.js
- Hono
Add payment middleware
Integrate payment middleware with:- A facilitator client pointing at the Polygon Amoy facilitator
- An
x402ResourceServerwith the EVM scheme registered - Route config using an
acceptsarray withscheme,price,network, andpayTo
- Express
- Next.js
- Hono
Full example in the x402 repo.
Running on Polygon mainnet
Once you have tested on Amoy, switch to mainnet:1. Update the facilitator URL
2. Update the network identifier
Changeeip155:80002 (Amoy) to eip155:137 (Polygon mainnet) in every
accepts entry and scheme registration: