Skip to Content
HomeLink Hub
Escrow

Start an escrow payment

POST
/api/v1/escrow/initialize

Access: Bearer token required. Also requires: Property (when propertyId is sent) must have legalStatus = legally_verified.

Opens a Pandascrow escrow for a property payment and returns the hosted payment link (payment_url) the buyer must open to fund it. The caller is always the buyer.

Fees. The server replaces escrowData.amount with amount + platformFee, where platformFee = round(amount x platformPropertyFeePercent / 100) (admin setting, default 1%). When transactionType is exactly purchase and the property has an assigned agent, an agent commission of round(amount x agentCommissionPercent / 100) (default 5%) is snapshotted; it is taken out of the seller's proceeds, not added to what the buyer pays (netAmount = amount - agentCommission). The base amount comes from the request and is not compared with the listing price.

Server-controlled fields. uuid, initiator_id, partner_id, partner_escrow_fee, payout and callback_url are set by the server after the caller's data, so values sent for them are ignored. The payout destination is the seller's (property landlordId) saved bank account when it has both an account number and a bank code; otherwise the release lands in the platform's Pandascrow wallet and the seller withdraws from their HomeLink Hub wallet. Every other key in escrowData is forwarded to Pandascrow unchanged.

Records created (only when propertyId is given and Pandascrow accepts the request): an EscrowTransaction with status pending; for inspection payments the inspection's escrowId is set; for every other type a Booking (type: reservation, status: requested) is created and linked both ways. Without a propertyId nothing is stored locally and the Pandascrow response is returned as is.

Next state. pending becomes funded when Pandascrow's escrow.paid webhook arrives, or when the buyer reports the payment through PATCH /escrow/{id}/payment-made. No email, socket event or notification is sent by this call.

The HTTP status is 200 whenever Pandascrow answers 2xx; success and message are Pandascrow's own status and message, so check success as well as the status code.

Authorization

bearerAuth
headerAuthorizationBearer <JWT>

Access token returned by sign-in. Send it as Authorization: Bearer <token>.

Request Body

application/json
  1. body
escrowData*

Escrow definition. Read by the server: propertyId, transactionType, amount, currency, description, inspectionId. Forwarded to Pandascrow untouched: escrow_type (onetime | milestone | recurring), initiator_role (buyer | seller | broker), title, inspection_period (days), delivery_date (YYYY-MM-DD), who_pay_fees (buyer | seller | both), buyer_details ({ name, email, phone? }), seller_details ({ name, email, phone? }) and optional acceptance_criteria, how_dispute_is_handled (platform | arbitration), dispute_window, prd_url. Overwritten by the server: uuid, initiator_id, partner_id, partner_escrow_fee, payout, callback_url. None of these are validated by this API; Pandascrow decides which are mandatory.

Response Body

  • Pandascrow accepted the escrow and a local record was created (propertyId was sent). success and message are passed through from Pandascrow (message text here is the one quoted in service/docs/ESCROW.md); data is Pandascrow's data object plus escrowTransactionId and, for non-inspection payments, bookingId. The code reads escrow_id, payment_url, transaction_ref and provider from Pandascrow's data; any other keys Pandascrow returns are passed through too.
  • No propertyId was sent, or Pandascrow answered 2xx with status: false / no data. Nothing is stored locally; Pandascrow's status, message and data are returned unchanged (success may be false with HTTP 200).
application/json
  1. response
status*integer
success*boolean
message*string
data*
Example Request
curl -X POST 'http://localhost:4000/api/v1/escrow/initialize' \  -H 'Content-Type: application/json' \  -d '{  "escrowData": {    "propertyId": "665e0a7b9b1d4a0012ab1f02",    "transactionType": "purchase",    "escrow_type": "onetime",    "initiator_role": "seller",    "title": "Purchase – 4 Bedroom Duplex, Lekki Phase 1",    "currency": "NGN",    "description": "Purchase payment for 4 Bedroom Duplex, Lekki Phase 1",    "inspection_period": 7,    "delivery_date": "2026-12-25",    "who_pay_fees": "buyer",    "amount": 45000000,    "buyer_details": {      "name": "Chinedu Okafor",      "email": "chinedu.okafor@example.com",      "phone": "+2348031234567"    },    "seller_details": {      "name": "Folake Adeyemi",      "email": "folake.adeyemi@example.com",      "phone": "+2348059876543"    },    "payout": {      "payout_type": "bank"    }  }}'
Example Response
{  "status": 200,  "success": true,  "message": "Escrow initialized successfully",  "data": {    "escrow_id": 48213,    "status": "pending",    "payment_url": "https://checkout.paystack.com/7k2m9x4q1z",    "transaction_ref": "PNDS-TRX-8F3A21C9D0",    "provider": "paystack",    "escrowTransactionId": "665f1c2e9b1d4a0012ab34cd",    "bookingId": "665f1c2f9b1d4a0012ab34d1"  }}