Availability
Mainnet x402 is disabled. Both authenticatedGET and POST /api/gateway return 503 gateway_mainnet_unavailable before contacting the facilitator. A configured verifier does not enable them.
The legacy facilitator route is separate from the GatewayClient endpoints, but uses the same mainnet refusal. The behavior below applies only to a configured testnet deployment.
GET /api/gateway
An API key is required. Supply an explicitsellerAddress query parameter. The caller must control that seller through the shared ownership gate; a foreign seller is refused with 403. There is no public balance lookup and no default-seller fallback.
On a successful configured request, the route returns success, sellerAddress, gatewayBalance, currency, chain and message. The facilitator URL and Circle chain value come from the server’s network configuration; do not derive the chain from an example string.
POST /api/gateway
An API key, seller ownership and all three body fields are required:sellerAddress, payoutAddress, and amount. Addresses must be valid; the amount is a plain USDC decimal string within the application cap.
payoutAddress is restricted by SELLER_GATEWAY_TREASURY_ADDRESSES. If no allowlist is configured, only the seller’s own address is allowed. This route is not an arbitrary-recipient withdrawal API and never defaults to a shared payout wallet.
A configured successful response uses gatewayReference, not a presumed on-chain txHash. Confirm receipts and credit independently before making an explorer or funds-available claim.
Separate seller endpoints
/api/x402/seller/balance and /withdraw use the GatewayClient boundary and also return gateway_mainnet_unavailable on mainnet. They are not aliases for this legacy facilitator route.
