REST API
REST API
Every endpoint, with real requests and responses. New here? Start with the Quickstart; Python users can skip the HTTP and use the SDK.
Base URL and authentication#
The public sandbox is https://sandbox.whire.ai. Every example on these pages was produced against a running deployment with the simulated rail on.
Send your key on every request, in either header:
X-API-Key: <your key>
Authorization: Bearer <your key>If both are present, X-API-Key is the one that counts. Whire issues your key; there is one per environment, and a sandbox key does not work in production. Send it only over https, never in a URL or query string, and keep it out of browser code, logs and screenshots. To replace a key, ask for a new one: the old and new keys work side by side until you say you have switched.
Three paths need no key: /api/health, /api/capabilities and /x402/supported. The documentation and the explorer page are public too. Everything else under /api, /x402 and /mcp needs one. The examples on these pages leave the header out to stay short; add -H "X-API-Key: $KEY" to each curl call.
There are two kinds of key. An operator key opens every endpoint on these pages. A seller key opens POST /x402/verify, POST /x402/settle and its own webhook endpoints only, for payments addressed to the IBAN or IBANs registered for that seller, and nothing else; see x402 over SEPA.
| Situation | Status | error |
|---|---|---|
| no key sent | 401 |
Missing API key. Send it as the X-API-Key header. |
| a key Whire does not know, including a revoked one | 401 |
Invalid API key. |
| a seller key used for anything but its own scope | 403 |
This key is a seller key. It can call POST /x402/verify, POST /x402/settle and manage its own webhook endpoints under /x402/webhooks, nothing else. |
A refused call is therefore never mistaken for an outage: an outage is a connection error or a 5xx, never a 401 or 403.
Your key is not what signs webhooks. Whire's calls to you carry a signature made with a separate secret for each endpoint.
Every response carries an X-Request-Id. Send your own on the request, 8 to 64 letters, digits, ., _, : or -, to match a call to your records; otherwise Whire makes one. Quote it when you ask about a call: it finds that call, and what it caused, in Whire's logs.
Every response is JSON:
{ "ok": true, "data": { ... } }
{ "ok": false, "error": "what went wrong, in words" }Errors are 400 with a message written to be read, 401 for a missing or wrong key, 403 for a key that may not do this, 404 for an unknown route, and 413 for a request body over 1 MiB.
Start with capabilities:
{ "authorization": true, "settlement": true, "simulated": true, "environment": "SANDBOX",
"note": "This deployment authorizes payments and settles them in simulation. No money moves." }settlement says whether the deployment moves money at all, simulated whether that money is simulated (see Simulation).
Endpoints#
| Method | Path | |
|---|---|---|
| GET | /api/health |
Liveness. |
| GET | /api/capabilities |
What this deployment can do. |
| POST | /api/payers |
Sign up a payer. |
| POST | /api/payers/{id}/activate |
Record the verification decision. |
| POST | /api/payers/{id}/funding-sources |
Add an account the payer can be debited from. |
| POST | /api/payers/{id}/suspend |
Suspend a payer: no new mandates. |
| GET | /api/payers/{id} |
Read a payer. |
| GET | /api/payers |
List payers. |
| POST | /api/beneficiaries |
Register who can be paid. |
| POST | /api/validate-iban |
Check an IBAN's format and checksum. |
| POST | /api/mandates |
Sign a mandate. |
| POST | /api/mandates/{id}/validate |
Run the ten checks against a possible payment without deciding anything. |
| POST | /api/mandates/{id}/revoke |
Revoke a mandate. |
| GET | /api/mandates/{id} |
Read a mandate. |
| GET | /api/mandates |
List mandates. |
| POST | /api/authorize |
Ask whether a payment may proceed. |
| POST | /api/authorize/verify |
Verify a receipt you were handed. |
| POST | /api/payouts |
Create a payout draft under a mandate. |
| POST | /api/payouts/{id}/submit |
Send the draft to KYC review. |
| POST | /api/payouts/{id}/events |
Record a provider decision yourself when no provider is configured: kyc_approved, kyc_rejected, payment_processing, payment_paid, payment_failed, payment_returned. |
| POST | /api/payouts/{id}/confirm |
Record a human go-ahead; optional, execute does not require it. |
| POST | /api/payouts/{id}/execute |
Send the payout through the rail. |
| GET | /api/payouts/{id} |
Read a payout with its history. |
| GET | /api/payouts?status=paid |
List payouts; ?status= filters. |
| GET | /api/simulation |
The simulated rail: scenarios, delay, every simulated account with its balance. |
| POST | /api/reset |
Empty the store and the simulated ledger. |
Virtual cards, /api/cards, have their own section: Virtual cards.
Idempotency#
Send Idempotency-Key: <uuid> on any POST that creates something. Same key and body again → the stored response is replayed (Idempotent-Replay: true). Same key while the first is still running → 409. Same key, different body → 422. Keys live 24 hours.
Limits#
- State is in memory; a redeploy or
POST /api/resetwipes it. Webhook endpoints survive a reset, though not a redeploy (see Webhooks). - One key per deployment: every caller sees every record. Cards are the exception: each key sees only the cards it issued (Virtual cards).
- No rate limiting. For status changes you can poll, or receive webhooks.
- EUR only.