x402 in 60 seconds
HTTP has reserved the status code402 Payment Required since 1997. The x402 protocol standardizes it for software: when a client requests a paid resource (an API, dataset, or compute job), the server responds with a 402 containing machine-readable payment terms. The client signs and pays, retrying with cryptographic payment proof.
SohoPay integrates x402 with USDC on Base and adds crucial institutional infrastructure: revolving credit lines, real-time risk policies, and sanctions screening. Settlement utilizes ERC-3009 TransferWithAuthorization directly on USDC.
The payment lifecycle
Merchants always receive 100% of the order total. The 5% transaction fee is charged directly to the operator’s revolving credit facility.
Step 1: Create an order
The merchant’s backend creates an order when an agent requests a paid resource:Response (201 Created):
Step 2: Submit the payment
The agent signs the order as EIP-712 typed data and submits the authorization signature. In the staging sandbox, pass"sandbox_auto" to test the loop without local key shares:
Step 3: Policy Service verification
Before co-signing, the Policy Service verifies four mandatory guardrails:- Merchant Allowlist: Validates that the merchant has approved this agent. Fails with
403 AGENT_NOT_ALLOWLISTED. - Agent Operational Status: Validates that the agent is not paused by its operator. Fails with
403 AGENT_PAUSED. - Credit & Velocity: Confirms the amount fits within
available_creditanddaily_limit. Fails with402 INSUFFICIENT_CREDIT. - AML Screening: Real-time wallet sanctions screening. Fails with
402 AML_DECLINED.
Step 4: On-chain settlement & verification
Once the Policy Service co-signs, SohoPay broadcasts the ERC-3009 settlement to Base. Confirmation takes ~1 second:Response
Next steps
Error Handling
Explore idempotency, backoff retries, and decline playbooks.
Testing Guide
Run end-to-end sandbox tests and simulate failure modes.
x402 Protocol
Review the low-level HTTP 402 specifications.

