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
- Agent requests
POST /paywithserviceUrl,maxAmount, andintent. - ZenithPay checks spend policy first (
SpendPolicy.sol). - ZenithPay calls seller route and receives x402 payment requirement (
402). - ZenithPay builds payment payload and calls x402
/verify. - ZenithPay calls x402
/settle. - Seller route returns paid data.
- 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)