# HTTP API (/docs/developers/http-api)

The routes behind the app. Public reads need nothing; private ones need the wallet's sign-in cookie; a few are operator-only.

**Auth:** none · **SIWE** (the `todoku_session` cookie from signing in with your wallet) · **ops** (SIWE plus an operator wallet) · **bearer** (an AI app's token).

## Public [#public]

| Method and path | What it returns |
| --- | --- |
| `GET /api/health` | Database and worker heartbeat |
| `GET /api/contracts` | This deployment's network, escrow and naira feed addresses (null until deployed) |
| `GET /api/prices` | Naira per dollar (before the margin) and QIE in dollars, cached 30 s |
| `GET /api/plans?service=` | Live data, TV and exam plans, cheapest first |
| `POST /api/verify` | A meter, smartcard or JAMB code checked by name (masked when signed out); 30 a minute |
| `POST /api/quotes` | Price and sign one order; 30 a minute per IP |
| `GET /api/orders/{id}` | One order's status, by its id (no full number, no token) |
| `POST /api/orders/{id}/tx` | "I paid": the web app reads that transaction's receipt at once and applies its escrow events |
| `GET /api/receipts/{slug}/card` | The receipt's share image |
| `GET /api/identity/{address}` | QIE ID name, paid and verified |
| `GET /api/demo-line` | The demo line's network and last four digits |
| `GET, POST /api/pay-links[/{id}]` | Make or read a pay link (10 per 10 minutes per IP) |
| `GET /api/shops/{handle}` | A shop's page data |
| `GET /api/swap`, `GET /api/loan` | A QUSDC → QIE swap transaction; a QIELend borrow plan (mainnet) |
| `GET /api/search` | Docs search |

## Signed in (SIWE) [#signed-in-siwe]

`/api/auth/nonce`, `/verify`, `/me`, `/logout` · `GET /api/orders` (history) and `/api/orders/export` (CSV) · `GET /api/orders/{id}/secret` (token or PINs, payer only) · tickets · saved numbers and `/api/prefill` · `/api/rewards` · `/api/quotes/bulk` (shops, 20 lines) · `/api/agent/*` · `/api/drops` (create, quote) · `/api/telegram` · `/api/account/connections`. Drop claims (`POST /api/drops/{id}/claim`) use the claimer's typed signature instead of a session.

## Operators [#operators]

`/api/ops/overview`, `/switches`, `/orders/{id}` (ask again, refund, mark delivered), `/agents` (suspend, reinstate).

## Webhooks [#webhooks]

| Route | Trust |
| --- | --- |
| `POST /api/webhooks/vtpass` | VTpass doesn't sign, so the body is only a hint: it is stored with tokens removed, acknowledged, and Todoku asks VTpass itself |
| `POST /api/webhooks/fonbnk` | The signature is checked on the raw body before anything else |

Both are de-duplicated by the body's SHA-256. MCP and OAuth routes are on their own pages. There is no public JSON for the scorecard: it is a page, [/scorecard](/scorecard).

For AI readers, every docs page is also Markdown at `/docs/<page>.md`, with [/llms.txt](/llms.txt) and [/llms-full.txt](/llms-full.txt).