Skip to main content
PAYMENTS

x402 Integration

Integrate x402 stablecoin payments with Originary to enable blockchain-based HTTP 402 payments that generate verifiable PEAC-Receipts.

What is x402?

x402 is a protocol built on the HTTP 402 status code that enables instant, blockchain-based payments for web resources and APIs. Developed by Coinbase, x402 allows users to pay for resources via API without registration, emails, OAuth, or complex signatures.

Originary integrates with x402 to normalize stablecoin payments into standard PEAC-Receipts, providing a unified proof of payment regardless of the payment rail used.

5-Minute Quickstart

  1. Deploy your peac.txt policy file
  2. Configure x402 payment endpoint in your Originary dashboard
  3. Return HTTP 402 with x402 payment challenge when access is gated
  4. Verify payment via x402 protocol
  5. Issue PEAC-Receipt header in response after payment confirmation

Code Example

// Challenge with 402
res.status(402).json({
  protocol: 'x402',
  amount: '1.00',
  currency: 'USDC',
  address: '0x...'
})

// After payment verification, issue receipt
res.setHeader('PEAC-Receipt', signedJWT)
res.json({ content: protectedData })

Ready to accept stablecoin payments?

Start accepting x402 payments with Originary today.

Get Started for $1