How It Works
- Buyer calls
pay(url, amount)with the seller’s URL and the expected USDC amount - The SDK negotiates a payment session with the x402 facilitator, submits an ERC-20 Transfer transaction on-chain, and attaches the authorization header to the request
- Seller middleware (
@x402/express) validates the header, extracts the payment details, and allows the request through - Both sides receive the on-chain transaction hash as proof of payment
Buyer SDK (@xpaylabs/x402)
Install:
One-shot Payment
Session-based Client
PAYMENT-RESPONSE header for audit.

