X
Push Chain x402

x402 Payment Protocol Demo

HTTP 402 on Push Chain Blockchain

API Response

Click "Make Request" to test the x402 payment flow

Ready to Test

This demo will test the x402 payment flow by making a request to a protected resource. The x402 SDK will automatically handle the payment when a 402 response is received.

✓ Using server-side payment processing with BUYER_PRIVATE_KEY from environment variables. No wallet approval needed.

🆕 New SDK Features

💳 Payment Options

REQUEST HEADERS

{ "X-PAYMENT": "Not sent" }

How x402Axios works

  1. Initial Request: Tries to access resource (no payment)
  2. 402 Response: Server responds with 402 Payment Required and payment details
  3. Automatic Payment: x402Axios intercepts the 402, processes payment via facilitator contract
  4. Retry with Proof: Automatically retries the original request with payment proof in X-Payment header
  5. Resource Delivered: Server verifies payment and returns the protected resource