Holda API
Escrow for Nigerian platforms. Your buyer pays into a hold by transfer from any bank. The money waits with our licensed escrow partner until the buyer confirms delivery, then goes to the seller. Holda never holds the funds, and neither do you.
https://holda.com.ng/api/v1Quickstart
1. Create a test key on the developer dashboard. 2. Create an escrow:
curl https://holda.com.ng/api/v1/escrows \
-H "Authorization: Bearer hk_test_..." \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-1042" \
-d '{
"amount": 4500000,
"description": "Black Chelsea boots, size 43",
"reference": "order-1042",
"buyer": { "name": "Tolu Bello", "email": "tolu@example.com" },
"seller": { "name": "Ada Fabrics", "email": "ada@example.com",
"bank_code": "058", "account_number": "0123456789" }
}'3. Show the buyer payment_instructions (a bank account just for this order), or send them to checkout_url. In test mode the page has a "Simulate bank transfer" button. 4. You get an escrow.funded webhook. 5. When the item is delivered, call release with the buyer's code, or let the buyer confirm in your app.
Try it live
Run the whole flow from this page with your test key: create an escrow, pay it, get the buyer's code, release, and watch the payout. Each step shows the matching code.
/escrowscurl -X POST https://holda.com.ng/api/v1/escrows \
-H "Authorization: Bearer hk_test_…" \
-H "Content-Type: application/json" \
-d '{ "amount": 4500000, "description": "Black Chelsea boots, size 43", "reference": "docs-ch0wgs", "buyer": { "name": "Tolu Bello", "email": "tolu@example.com" }, "seller": { "name": "Ada Fabrics", "phone": "08030000000", "bank_code": "058", "account_number": "0123456789" } }'Authentication
Send your secret key as a bearer token. Keys start with hk_test_ or hk_live_. Keep them on your server, never in an app or a web page.
Authorization: Bearer hk_test_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxTest and live
Test keys only see test escrows, and no real money moves. Live keys create real escrows held by our licensed partner. Live mode is opening soon. Build and test now; your code won't change when you switch keys.
How an escrow moves
- pending Created. Waiting for the buyer to pay at
checkout_url. - funded The money is held. Tell the seller to dispatch.
- delivered The seller delivered. If nobody acts, the escrow releases after
auto_release_hours(default 72). - released The seller has been paid. Final.
- refunded The buyer got the money back. Final.
- disputed Frozen while Holda reviews. Ends as released or refunded.
- cancelled Cancelled before payment. Final.
The escrow object
All money fields are integers in kobo (₦1 = 100 kobo). Timestamps are Unix seconds.
{
"id": "esc_8Hf2kQ9mX1pL4rT7vW0a",
"object": "escrow",
"livemode": false,
"reference": "order-1042",
"status": "funded",
"amount": 4500000,
"currency": "NGN",
"fee": 67500,
"platform_fee": 0,
"seller_payout": 4432500,
"description": "Black Chelsea boots, size 43",
"buyer": { "name": "Tolu Bello", "email": "tolu@example.com", "phone": null },
"seller": { "name": "Ada Fabrics", "email": "ada@example.com", "phone": null,
"bank_code": "058", "account_number": "******6789",
"account_name": "ADA FABRICS LTD", "account_name_matches": true },
"metadata": {},
"checkout_url": null,
"payment_instructions": null,
"amount_received": 4500000,
"payout": null,
"auto_release_hours": 72,
"delivery": null,
"released_via": null,
"created": 1795600000,
"funded_at": 1795600420
}| Create parameter | Required | Notes |
|---|---|---|
amount | Yes | Kobo. ₦100 to ₦50m. |
description | Yes | What's being bought. Shown to the buyer. |
buyer | Yes | name plus email or phone. |
seller | Yes | name plus email or phone; bank_code and 10-digit account_number for payout. |
reference | No | Your order id. Unique per account and mode. |
platform_fee | No | Your commission in kobo, taken from the seller's payout. |
auto_release_hours | No | 1 to 720. Default 72. |
metadata | No | Any JSON object up to 4KB. Returned as-is. |
Endpoints
| POST | /escrows | Create an escrow. Returns payment_instructions and a checkout_url for the buyer. |
| GET | /escrows | List escrows. Filter with status, reference; page with starting_after. |
| GET | /escrows/{id} | Retrieve one escrow. |
| POST | /escrows/{id}/deliver | Mark delivered (optionally with courier and tracking). Starts the auto-release clock. |
| GET | /escrows/{id}/handover_code | The buyer's 4-digit code. Show it to the buyer only, after they've paid. |
| POST | /escrows/{id}/release | Pay the seller. Pass handover_code to release with the code from the door. |
| POST | /escrows/{id}/rotate_code | Replace the handover code if it was seen too early. |
| POST | /escrows/{id}/refund | Return the money to the buyer. |
| POST | /escrows/{id}/dispute | Freeze the money. Holda reviews and decides. |
| POST | /escrows/{id}/cancel | Cancel an escrow the buyer hasn't paid. |
| POST | /escrows/{id}/payout_account | Add or fix the seller's bank account ({ bank_code, account_number }). Checked with the bank; retries a stuck payout. |
| GET | /escrows/{id}/payout | Where the seller payout or buyer refund is: queued, processing, paid or review. |
| POST | /escrows/{id}/simulate_payment | Test mode: the buyer sends a bank transfer. Pass { amount } to test a part payment. |
| POST | /escrows/{id}/resolve | Test mode: simulate Holda's dispute decision ({ outcome: release | refund }). |
Deliver with tracking:
curl -X POST https://holda.com.ng/api/v1/escrows/esc_.../deliver \
-H "Authorization: Bearer hk_test_..." -H "Content-Type: application/json" \
-d '{ "courier": "GIG Logistics", "tracking_number": "GIG4471902" }'Handover codes
Holda's pay-on-delivery moment. Once the buyer has paid, fetch their 4-digit code and show it to the buyer only. At the door, the buyer checks the item and reads the code to the seller or rider, who enters it in your app. You release with it:
curl -X POST https://holda.com.ng/api/v1/escrows/esc_.../release \
-H "Authorization: Bearer hk_test_..." -H "Content-Type: application/json" \
-d '{ "handover_code": "4821" }'Five wrong codes lock the escrow (423 code_locked). If the code was seen too early, call rotate_code; the old one stops working.
Payments and payouts
Paying in. Each escrow gets its own bank account. While the escrow is pending, payment_instructions tells the buyer where to send the money:
"payment_instructions": {
"bank_name": "Holda Sandbox Bank",
"account_number": "9904817263",
"account_name": "HOLDA ESCROW (TEST)",
"amount": 4500000,
"expires_at": null
}The escrow becomes funded once the full amount arrives. If the buyer sends less, it stays pending: amount_received goes up and payment_instructions.amount shows what's left. If they send more, the escrow is funded and Holda returns the extra to the buyer.
Checking the seller. When you give a seller account, Holda asks the bank whose it is. You get seller.account_name and account_name_matches (does it look like the seller's name?). A bad account is refused at creation, not discovered at payout.
Paying out. On released, the seller is paid seller_payout. On refunded, the buyer is paid back to the account they paid from. Each escrow is paid out once, never twice. Holda checks the account name again just before sending. Follow progress in payout on the escrow, at GET /escrows/{id}/payout, or by webhook:
queued | Waiting to send, or waiting to retry after a bank timeout. Retries happen automatically. |
processing | The bank has it. Holda checks back until it settles. |
paid | The money has left. You get payout.paid. |
review | It couldn't be sent (closed account, name changed, no bank details). You get payout.failed with a reason. Fix the account with payout_account and it sends again. |
Test accounts. In test mode, the seller's account number decides what happens: 0000000000 doesn't exist; ending 0001 is closed (payout goes to review); ending 0002 times out once, then pays; ending 0003 settles slowly. Anything else pays straight away.
Webhooks
Set your endpoint on the dashboard. Events: escrow.funded, escrow.delivered, escrow.release_soon (24 hours before an automatic release, so you can remind your buyer), escrow.released, escrow.refunded, escrow.disputed, escrow.cancelled, payout.paid, payout.failed and test.ping. For escrow.* events the body's data is the escrow object; for payout.* it's the payout.
Every request has a Holda-Signature header: t=<unix seconds>,v1=<hex HMAC-SHA256> of "<t>.<raw body>" with your signing secret. Reply 2xx within 10 seconds. We retry after 1m, 5m, 30m, 2h, 12h and 24h, and you can resend from the dashboard. Deduplicate on the event id.
import crypto from "node:crypto";
export function verifyHolda(rawBody, header, secret) {
const parts = Object.fromEntries(header.split(",").map((p) => p.split("=")));
const t = Number(parts.t);
if (!t || Math.abs(Date.now() / 1000 - t) > 300) return false; // 5-minute window
const expected = crypto.createHmac("sha256", secret).update(`${t}.${rawBody}`).digest("hex");
return crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1 ?? ""));
}Errors
{ "error": { "type": "invalid_state", "message": "The buyer hasn't paid yet" } }400 invalid_request | A parameter is missing or wrong. The message says which. |
401 unauthorized | Missing, wrong or revoked key. |
403 live_mode_unavailable | Live keys aren't open yet, or your account isn't approved for live. |
503 live_mode_unavailable | Live payments aren't connected to a bank yet. |
404 not_found | No such escrow (or it belongs to the other mode). |
409 invalid_state / conflict | Not allowed in the escrow's current status, or a duplicate reference. |
422 limit_exceeded | Live only: over your per-escrow or daily limit. Limits rise as your volume and history grow; ask us. |
403 held_for_review | A party couldn't pass screening. Don't retry; Holda's compliance team will contact you. |
422 invalid_code · 423 code_locked | Wrong handover code; too many wrong codes. |
429 rate_limited | Over 120 writes a minute on one key. |
500 server_error | Our fault. Retry with the same Idempotency-Key. |
Idempotency
Send an Idempotency-Key header on any POST. If you retry with the same key, you get the first response back (with Idempotent-Replayed: true) and nothing happens twice. Use your order id or a UUID.
Fees
Holda charges 1.5% of the amount, taken from the seller's payout and shown as fee. Your platform_fee comes out of the payout too, and seller_payout is what the seller receives. No setup or monthly fee.
Holda is a technology service of The 36th Solutions Ltd (RC 9440452). Funds are held by a licensed escrow partner and a bank licensed by the Central Bank of Nigeria. Questions: developer dashboard.