# How the money moves (/docs/guide/how-it-works)

Your payment waits in a contract on QIE. It can only go to Todoku after delivery, back to you, or to you again after the reclaim delay.

<Diagram name="payment" alt="Sequence of one airtime order from price to release" caption="One order end to end. The refund and reclaim paths are in the note at the bottom." />

## The four endings [#the-four-endings]

| Ending | When | Who triggers it | Where the money goes |
| --- | --- | --- | --- |
| **Released** | The provider confirms delivery | Todoku's operator key | Todoku's treasury |
| **Refunded** | The provider fails, refuses or reverses | Todoku's operator key | Back to your wallet, in QUSDC |
| **Taken back** | The reclaim delay has passed and the order is still held | You, from the order page | Back to your wallet, in QUSDC |
| **Not paid** | You never paid the price | Nobody | Nothing moved |

Money the escrow owes can only go to three places: Todoku's treasury, the wallet that paid, or a drop's funder. The admin can sweep only the surplus above what it owes. It is not upgradeable, so nobody can change those rules after it is deployed.

## Step by step [#step-by-step]

1. **A price, signed.** Todoku prices the bill in QUSDC and signs it (EIP-712). The price holds for 60 seconds; the sheet re-prices just before it runs out.
2. **One signature.** Paying in QIE calls `payWithQIE`: the escrow swaps on QIEDEX for the exact QUSDC the bill costs and sends any leftover QIE straight back to you. Paying in QUSDC is an approval, then `payWithQUSDC`.
3. **Held.** The escrow emits `OrderPaid`. Todoku's worker sees it within seconds and buys the bill from the provider (VTpass for Nigeria).
4. **Delivered or not.** Only the provider's answer settles it. Delivered: `release`. Failed: `refund`. Still unsure: Todoku asks again after 15 seconds, then 1 minute later, then 5 minutes later, then every 15 minutes, and after 24 hours an operator reviews it.
5. **Your fallback.** While the money is still held, the wallet that paid can call `reclaim` after the delay set in the contract when it is deployed: 24 hours planned for production, 10 minutes on the test build. The app reads the real value from the contract. The order page shows the exact time and a **Take back** button.

## What it costs [#what-it-costs]

There is no fee line: the review sheet shows **Our fee ₦0**. Todoku earns the provider's commission, and it prices QUSDC at 1% under the reference rate (Paycrest's USDC to naira), so the price carries a 1% margin. Paying in QIE adds the QIEDEX swap cost, shown on the sheet as a percentage. Refunds return the full QUSDC you paid.

<Cards>
<Card title="The escrow contract" href="/docs/qie/escrow" description="Every function, who may call it, and what pause stops." />

<Card title="Order status map" href="/docs/developers/status-map" description="All 13 states and what moves an order between them." />
</Cards>