Start an escrow payment
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.
bearerAuthAuthorizationBearer <JWT>Access token returned by sign-in. Send it as Authorization: Bearer <token>.
application/json- 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.
- Pandascrow accepted the escrow and a local record was created (
propertyIdwas sent).successandmessageare passed through from Pandascrow (message text here is the one quoted in service/docs/ESCROW.md);datais Pandascrow'sdataobject plusescrowTransactionIdand, for non-inspection payments,bookingId. The code readsescrow_id,payment_url,transaction_refandproviderfrom Pandascrow's data; any other keys Pandascrow returns are passed through too. - No
propertyIdwas sent, or Pandascrow answered 2xx withstatus: false/ no data. Nothing is stored locally; Pandascrow'sstatus,messageanddataare returned unchanged (successmay befalsewith HTTP 200).
application/json- response
status*integersuccess*booleanmessage*stringdata*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" } }}'{ "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" }}Get a transaction by ID GET
Returns one Transaction record with propertyId populated (title, location, media, pricing), but only when the caller is parties.from or parties.to; someone else's transaction is...
Complete an escrow on Pandascrow (raw passthrough) POST
Thin proxy to Pandascrow's POST /escrow/complete: forwards userId as Pandascrow's uuid, escrowId as escrowid and the otp, then returns Pandascrow's status, message and data.