Skip to main content

Overview

For Buyers

Before (V1)

After (V2)

Key Changes

  1. Package rename: x402-axios@x402/axios
  2. Function rename: withPaymentInterceptorwrapAxiosWithPayment
  3. Wallet setup: Use x402Client with .register() builder pattern instead of passing wallet directly
  4. No chain-specific configuration: The V2 client automatically handles network selection based on payment requirements

For Sellers

Before (V1)

After (V2)

Key Changes

  1. Package rename: x402-express@x402/express
  2. Configuration structure: Route config now uses accepts array with explicit scheme, network, and payTo
  3. Network format: base-sepoliaeip155:84532 (CAIP-2 standard)
  4. Resource server: Create x402ResourceServer with facilitator client and register schemes using the .register() builder pattern
  5. Price recipient: Explicitly specify payTo address per route

Schema Declaration

In V2, hand-rolling extensions.bazaar.schema on a route config passes through @x402/core unchanged but fails silently during discovery-crawler verification, because the required envelope fields (type, method, bodyType, body for input; type, example for output) are only populated by the declareDiscoveryExtension() helper from @x402/extensions/bazaar. V1 declared these as config.inputSchema / config.outputSchema and relied on middleware forwarding; V2 requires the helper and spreads its return value into extensions.bazaar. See the Bazaar Discovery Extension documentation for full helper usage.

Network Identifier Mapping

Package Migration Reference

Header Changes

If you’re implementing custom HTTP handling, update your header names:

Troubleshooting

”Cannot find module” errors

Ensure you’ve installed all V2 packages:

Payment verification failures

  • Check you’re using CAIP-2 network identifiers (eip155:84532 not base-sepolia)
  • Verify your payTo address is correctly configured
  • Ensure the facilitator URL is correct for your network (testnet vs mainnet)

Mixed V1/V2 compatibility

The facilitator supports both V1 and V2 protocols. During migration, your V2 server can still accept payments from V1 clients, but we recommend updating clients to V2 for full feature support.

Next Steps