Install the SDK
Integration paths
Choose the guides that match your role in the x402 ecosystem.Buyer (client-side)
Add nanopayments to your x402 client so it can pay gas-free when servers
support it
Seller (server-side)
Add gas-free nanopayments to your existing x402 server alongside your
current payment flows
Facilitator
Route Gateway payments alongside onchain payments in your facilitator
service
Seller (server-side)
AddBatchFacilitatorClient and GatewayEvmScheme to your existing server.
Your 402 responses then include both standard and Gateway payment options:
Buyer (client-side)
UseCompositeEvmScheme to handle both Gateway and standard payments
automatically. The client picks the right scheme based on what the server
offers:
Facilitator
UseisBatchPayment() to route Gateway payments to BatchFacilitatorClient
while your existing handler covers standard payments:
How routing works
When both payment methods are available, routing is automatic at every layer:| Layer | What happens |
|---|---|
| Server | The 402 response lists both standard and Gateway options in the accepts array. |
| Client | CompositeEvmScheme checks each option’s extra.name. If "GatewayWalletBatched" is present, it uses BatchEvmScheme. Otherwise it uses ExactEvmScheme. |
| Facilitator | isBatchPayment() checks the same extra.name field and routes verify/settle calls to either Gateway or the existing onchain handler. |