The best way to accept digitalpayments
Built around the HTTP 402 status code, x402 enables users to pay for resources via API without registration, emails, OAuth, or complex signatures.
Powering Next-Gen DigitalCommerce
x402 unlocks new monetization models, offering developers and content creators a frictionless way to earn revenue from small transactions without forcing subscriptions or showing ads.
1 Line of Code to Accept Digital Dollars
Just add a single line of code in your app, and you can require a USDC payment for each incoming request.
paymentMiddleware("0xYourAddress", {"/your-endpoint": "$0.01"});
// and that’s it!
If a request arrives without payment, the server responds with HTTP 402, prompting the client to pay and retry.
HTTP/1.1 402 Payment Required
x402 allows any web developer to accept crypto payments without the complexity of interacting directly with the blockchain.