Escrow
PAYDER holds the buyer's money until your conditions are met, then pays the seller's PAYDER wallet, or refunds the buyer.
Overview
Use escrow when a buyer pays before the seller has delivered, for example a marketplace order. The buyer pays PAYDER, PAYDER holds the money, and it moves only when the deal is settled. Escrow money never passes through your own balance: the seller is paid into their PAYDER wallet, your commission (if any) is paid into your own PAYDER wallet, and the buyer is refunded to their PAYDER wallet.
| Who | Needs | Does |
|---|---|---|
| You (merchant) | A merchant ID and API key | Create the escrow, then release, refund or cancel it. Receive webhooks. |
| Buyer | A PAYDER account (only at the moment of paying) | Opens payUrl and pays from their PAYDER wallet. Can release early or ask for a refund. |
| Seller | A PAYDER account and wallet ID (10 digits) | Receives the money on release. Can refund the buyer in full. |
| PAYDER admin | Decides disputes you cannot settle: buyer, seller or a split. |
Life of an escrow
- The seller gives you their 10-digit wallet ID. Check that it exists with
GET /v1/accounts/:walletId(live). Optionally link the wallet first (see Linking a seller's wallet below). - You call
POST /v1/escrowsand send the buyer topayUrl. The buyer has 3 minutes to pay by default (PAYDER can set a longer window for your account). After that the escrow ends asfailedand you create a new one. - The buyer signs in to their own PAYDER account and pays from their wallet. A buyer without enough money adds it by card or transfer first. You get
escrow.funded. Status:funded. - PAYDER now holds the money. The seller cannot spend it and the buyer cannot take it back on their own.
- When your conditions are met you call
release(or the buyer taps release), and the money goes to the seller and your commission wallet. If you setautoReleaseHours, PAYDER releases automatically after that many hours unless a dispute is open. Without it, money stays held until you or the buyer release it. - If the deal fails, the buyer files a refund request in PAYDER. The escrow becomes
disputed, auto-release stops, and you getescrow.disputed. You then callrefund, the seller refunds, or a PAYDER admin decides.
Create an escrow
Send the usual headers, including a unique Idempotency-Key.
| Field | Type | Notes |
|---|---|---|
reference | string, required | Your unique id for this escrow (for example the order code). Up to 100 characters from A-Z a-z 0-9 . _ : -. A repeat is refused with 409 duplicate_reference. |
amount | integer, required | The full amount in kobo that the buyer pays and PAYDER holds. Minimum 10,000 (₦100). |
currency | string, required | Always "NGN". |
seller.walletId | string, required | The seller's PAYDER wallet ID, exactly 10 digits. Live: it must exist, or 422 account_not_found. |
buyer.email | string | If set, only the PAYDER account with this email can pay. |
feeAmount | integer | Your commission in kobo (not more than amount). Taken from the seller's side on release, in proportion to what the seller keeps. Not charged on money refunded to the buyer. |
feeWalletId | string | Your own PAYDER wallet ID (10 digits). Required when feeAmount is more than 0; the commission is paid there. |
autoReleaseHours | integer | Optional, 1 to 720. After it is funded, PAYDER releases to the seller this many hours later unless a dispute is open. Left out means no deadline: PAYDER never releases by age. |
conditions | string | Up to 1,000 characters, shown to both parties, for example "Release when the item is handed over". |
description | string | Up to 255 characters. |
returnUrl | string | Where the buyer is sent back to after paying. Live: https only. |
metadata | object | Your own key/value data. Returned unchanged. |
curl -s $BASE/v1/escrows \
-H "Authorization: Bearer $KEY" -H "X-Merchant-Id: $MID" \
-H "Idempotency-Key: $(uuidgen)" -H "Content-Type: application/json" \
-d '{
"reference": "ORD-1001",
"amount": 1250000,
"currency": "NGN",
"description": "Laptop, order Q-1001",
"seller": { "walletId": "1234567890" },
"feeAmount": 62500,
"feeWalletId": "0987654321",
"autoReleaseHours": 72,
"conditions": "Release when the buyer receives the laptop.",
"returnUrl": "https://example.com/orders/1001"
}'{ "id": "esc_8a2c...", "reference": "ORD-1001", "status": "pending_payment", "payUrl": "https://www.payder.ng/escrow/esc_8a2c..." }Settling an escrow
| Call | What it does |
|---|---|
GET /v1/escrows/:reference | Returns the escrow (fields below). Use it if a webhook is missed. |
POST /v1/escrows/:reference/release | Conditions met: pay the seller, less your commission and PAYDER's fee. Works on a funded or disputed escrow. |
POST /v1/escrows/:reference/refund | Body {"{ amount?, reason? }"} (amount in kobo, reason up to 255 characters). With no amount it is a full refund. With an amount, the buyer gets that (less PAYDER's refund fee) and the rest goes to the seller (less your commission and PAYDER's fee). The amount cannot be more than the escrow. |
POST /v1/escrows/:reference/cancel | Cancels an escrow that is still unpaid. A paid one must be refunded instead, otherwise 409 conflict. |
GET /v1/accounts/:walletId | Does this PAYDER wallet exist? Returns a masked name. |
A release or refund can happen once. Whichever arrives first wins, and the other gets 409 conflict (the message says it is not holding money). This also protects you from a release and a refund racing each other. Repeat the same request with the same Idempotency-Key and you get the original answer.
Fees
There are two separate charges, both taken from the held money when the escrow settles. Nothing extra is charged to the buyer on top of amount.
| Charge | Rate | Taken from |
|---|---|---|
| Your commission (feeAmount) | The amount you set | The seller's share, in proportion to what the seller keeps. Paid to your feeWalletId. |
| PAYDER fee on release | 1% by default (your own agreed rate if PAYDER set one) | The seller's share, calculated on the amount released to the seller (before your commission). |
| PAYDER fee on refund | Half that rate: 0.5% by default | The refunded amount, so the buyer gets slightly less than the refund. |
The PAYDER fee is never more than the share it is taken from. It is the same rate that applies to your checkouts, so a custom rate set for your account applies here too. Fees are not refunded.
| Example: ₦12,500 escrow, ₦625 commission | Buyer gets | Seller gets | You (commission) | PAYDER |
|---|---|---|---|---|
| Released in full | ₦0 | ₦11,750.00 | ₦625.00 | ₦125.00 (1% of ₦12,500) |
| Refunded in full | ₦12,437.50 | ₦0 | ₦0 | ₦62.50 (0.5% of ₦12,500) |
| ₦5,000 refunded, rest released | ₦4,975.00 | ₦7,050.00 | ₦375.00 | ₦100.00 (₦25 + ₦75) |
In every row the four amounts add up to the ₦12,500 that was held. Your commission on a partial settlement is proportional: ₦625 × (₦7,500 ÷ ₦12,500) = ₦375.
Disputes
- The buyer can file a refund request while the escrow is
funded. The status becomesdisputed, any auto-release is cancelled, and you getescrow.disputed. The buyer can withdraw the request. - You can end it yourself by calling
refund(full or partial) orrelease. - If you and the seller do not settle it, a PAYDER admin decides: full refund to the buyer, full release to the seller, or a split. The fees above apply to whatever each side receives.
The escrow object
| Field | Meaning |
|---|---|
id, reference | PAYDER's id (esc_...) and your reference. |
status | See the statuses below. |
amount, currency | Amount held, in kobo, and "NGN". |
feeAmount | Your commission, in kobo, as you set it. |
payderFee | PAYDER's own fee in kobo. 0 until the escrow is settled; then the release fee plus the refund fee. |
refundedAmount | Kobo sent back to the buyer, before PAYDER's refund fee. |
buyer | {"{ email, hasPayderAccount }"} |
seller | {"{ walletId }"} |
description, conditions, metadata | As you sent them. |
payUrl | The page the buyer pays on. |
paidVia | How it was funded (for example the buyer's wallet). |
disputeReason | The buyer's text when disputed, otherwise null. |
createdAt, fundedAt, releaseAt, releasedAt, refundedAt | Timestamps. releaseAt is when auto-release will happen, if set. |
Statuses
| Status | Meaning | Next |
|---|---|---|
pending_payment | Created, waiting for the buyer. | funded, cancelled or failed |
funded | Paid. PAYDER is holding the money. | released, refunded or disputed |
disputed | The buyer asked for a refund. Auto-release is paused. | released or refunded |
released | The seller was paid (this also covers a split where the seller got part). | final |
refunded | The whole amount went back to the buyer. | final |
cancelled | You cancelled it before payment. | final |
failed | Not paid within the payment window (3 minutes by default). Older escrows may show expired. | final |
Webhook events
Each event is signed like every other event and has the body { id, event, reference, amountMinor, currency, occurredAt }. reference is your escrow reference.
| Event | Meaning | amountMinor |
|---|---|---|
escrow.funded | The buyer paid. PAYDER is holding the money. | The escrow amount |
escrow.disputed | The buyer asked for a refund. Release is paused. | The escrow amount |
escrow.released | Money went to the seller. Sent whenever any part is released, including after a partial refund. | The seller's share before your commission and PAYDER's fee |
escrow.refunded | Money went back to the buyer. Sent whenever any part is refunded. | What was refunded, before PAYDER's refund fee |
escrow.cancelled | Cancelled before payment. | The escrow amount |
A partial refund sends both escrow.refunded and escrow.released. Always confirm the final state with GET /v1/escrows/:reference before you act on money.
Errors
| Status / code | When |
|---|---|
400 invalid_request | A field is missing or wrong: amount below ₦100, feeAmount above amount, feeAmount without feeWalletId, bad wallet ID, autoReleaseHours outside 1 to 720, refund amount above the escrow. |
404 not_found | No escrow with that reference. |
409 duplicate_reference | An escrow with this reference already exists. |
409 conflict | Release or refund on an escrow that is not holding money, or cancel on one that has been paid. |
422 account_not_found | Live: the seller or fee wallet ID does not exist. |
422 wallet_not_linked | Your account requires linked wallets and this seller has not approved a link. |
Test it in the sandbox
- Create a sandbox merchant and key in the console, then create an escrow with any 10-digit seller wallet ID. In the sandbox you can use the test wallets
0000000001,0000000002or0000000003. No real account is needed. - Open
payUrland press Pay (sandbox). You getescrow.fundedand the status isfunded. - Call
release. You getescrow.releasedand the status isreleased. - Repeat with a new reference and call
refundwith no amount, then with an amount, to seeescrow.refundedand the partial split. - Try the errors: the same reference twice (409), a release after a refund (409), an amount below 10,000 (400).
payderFee is still calculated, so you can check your numbers. Escrow is not part of the six go-live checklist tasks, but test it before you use it live. Live escrows need real PAYDER accounts for the seller, the buyer and your commission wallet.Linking a seller's wallet
Before paying a seller you can ask them to link their PAYDER wallet to your app. Nothing is linked until the wallet's owner approves it in the PAYDER app with their transaction PIN. You never see or handle the PIN.
| Call | What it does |
|---|---|
POST /v1/wallet-links | Body { linkRef, walletId, requesterName, expiresInMinutes (5-60) }. requesterName must be the name on the seller's account with you and must match the name on the PAYDER wallet (word order and middle names don't matter). If it does not, you get 422 name_mismatch and the owner is never asked. Returns 201 { linkId, linkRef, status: "PENDING", walletId, walletName (masked), expiresAt }. The same linkRef returns the same link (200). A newer request for the wallet cancels the older pending one. At most 5 requests per wallet per hour. |
GET /v1/wallet-links/:linkId | Status: PENDING, APPROVED, REJECTED, EXPIRED or REVOKED. Use it if a webhook is missed. |
DELETE /v1/wallet-links/:linkId | Unlink from your side (immediate). Fires wallet.link.revoked. When the wallet owner wants to unlink, PAYDER approves it first. |
POST /v1/wallet-links/:linkId/unlink-response | Answer PAYDER's query when a customer asks to unlink. Body { hasOutstanding: boolean, amountMinor?, note? }. One answer per query. If you say the customer owes you, PAYDER refuses the unlink. |
GET /v1/wallets/:walletId/balance | Returns { availableMinor, heldMinor, currency }. Only for an APPROVED link, otherwise 403. |
POST /v1/sandbox/wallet-links/:linkId/approve | reject | Sandbox only: decide a request without a PIN. Sandbox test wallets (use the wallet's name as requesterName): 0000000001 Amaka Test Seller, 0000000002 Tunde Test Seller, 0000000003 Ngozi Test Seller. |
| Webhook event | Meaning |
|---|---|
wallet.link.approved | The owner approved with their PIN. walletName is the registered holder name. |
wallet.link.rejected | The owner declined. |
wallet.link.expired | Nobody decided in time. |
wallet.link.revoked | Unlinked by the owner or by you. |
wallet.link.unlink_requested | The owner asked to unlink and PAYDER is asking whether they owe you anything (body has an optional note). Reply with unlink-response. Includes unpaid orders, installments or fees. |
Body: { id, event, reference (= linkId), linkId, linkRef, walletId, walletName, occurredAt }, signed like every other event. If your account has "require linked wallets" switched on, creating an escrow for a seller wallet that has not approved a link is refused with wallet_not_linked.