Create and fund a task

A worked walk-through — fund your wallet, estimate the work, and create a task under escrow.

This guide takes you from an empty wallet to a live task. It assumes you have an API key (Authentication).

1. Check your wallet

GET/v1/wallet
curl https://api.hannu.africa/v1/wallet \
  -H "Authorization: Bearer $HANNU_KEY"
JSON
{ "data": { "balance_minor": "0", "currency": "NGN" } }

2. Fund it

POST /v1/wallet/fund is read-only: it returns the funding options and the minimum top-up for your org, and changes nothing — no Idempotency-Key, no amount to send. Follow the returned instructions to move money in; the balance updates when the deposit settles at the partner.

POST/v1/wallet/fund
curl -X POST https://api.hannu.africa/v1/wallet/fund \
  -H "Authorization: Bearer $HANNU_KEY"
Money is integer minor units

Amounts are always in kobo (or cents) as integers — a balance_minor of 500000 is ₦5,000.00. Never treat one as a float.

3. Estimate the work

POST/v1/estimate_task
curl -X POST https://api.hannu.africa/v1/estimate_task \
  -H "Authorization: Bearer $HANNU_KEY"

4. Create it — escrow locks

If the wallet holds enough, create_task locks escrow and enters safety screening. If it doesn't, you get insufficient_escrow_balance (402) — fund more and retry.

POST/v1/tasks
curl -X POST https://api.hannu.africa/v1/tasks \
  -H "Authorization: Bearer $HANNU_KEY" \
  -H "Idempotency-Key: $(uuidgen)"

From here, subscribe to webhooks and wait for task.approved — or poll GET /v1/tasks/:id until it reaches approved.