ZenithPay iconZenithPay
Concepts

x402 Payment Flow

Buyer and seller lifecycle for ZenithPay x402 payments on Base

This page explains the end-to-end x402 lifecycle implemented by ZenithPay.

Roles

  • Buyer route: POST /pay (agent/operator entry point)
  • Seller route: GET|POST /sell/agent-intel (x402 challenge + paid resource)
  • Facilitator: x402 protocol facilitator on Base

Sequence

  1. Agent requests POST /pay with serviceUrl, maxAmount, and intent.
  2. ZenithPay checks spend policy first (SpendPolicy.sol).
  3. ZenithPay calls seller route and receives x402 payment requirement (402).
  4. ZenithPay builds payment payload and calls x402 /verify.
  5. ZenithPay calls x402 /settle.
  6. Seller route returns paid data.
  7. ZenithPay writes ledger + returns transaction result.

Why this model

  • policy gate is enforced before value movement
  • settlement uses a standardized HTTP-native payment protocol
  • buyer and seller concerns are clearly separated

Production endpoints

  • Buyer: https://zp-api-q4hd.onrender.com/pay
  • Seller: https://zp-api-q4hd.onrender.com/sell/agent-intel
  • Network: Base mainnet (chain ID 8453)
  • Settlement token: USDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913)

On this page