# How it works

x402 moves the money; Tollfair adds the grade and the gate. The tollbooth is an npm package running on the seller's own server, so payment goes straight from agent to seller.

> Preview: the tollbooth and grades are not live yet. This describes how they will work.

## The request

1. The agent sends GET /dataset to the seller's API, which runs the Tollfair booth.
2. The booth replies 402 Payment Required with price, grade, provenance, freshness and licence.
3. The agent retries with an x402 payment.
4. The booth asks the facilitator to verify the payment.
5. The booth fetches the data from the seller's API.
6. The seller's API returns the data with status 200.
7. The booth asks the facilitator to settle.
8. The facilitator sends USDC to the seller's wallet.
9. The agent receives the data and a receipt. Tollfair gets a copy of the receipt.

No data, no charge: the facilitator settles only after the seller's API returns data.

We never hold funds. Money goes agent to seller wallet; Tollfair only checks and logs.

## What the booth adds to plain x402

- Grade, provenance, freshness and licence inside the 402 response, so the agent decides before it pays.
- Agent rules set by the seller: verified agents only, a lower price for verified agents, or a free sample for unverified ones.
- Two payment routes from one install: x402 stablecoins, and Stripe's Machine Payments Protocol for cards and pounds.
- A listing in the Tollfair catalogue and in agent discovery files.
