Escrow and Receipts
Tracking an escrow transaction, reporting a payment with proof, releasing funds with an OTP, and the prototype escrow status, contract and receipt screens.
When the platform runs in ESCROW mode, each rent, purchase or stay payment becomes an escrow transaction. The tenant follows it on a live status screen: fund it, report the payment if it is not picked up, and finally confirm the handover so the money is released to the seller. Three further screens (a static escrow timeline, a legal contract and a receipt) are design prototypes with fixed content.
Where it lives
| Screen | Route | File | Who sees it |
|---|---|---|---|
| Escrow Status (live) | /property/escrow/[id] | app/property/escrow/[id].tsx | The tenant who started the escrow |
| Escrow Status (prototype) | /property/escrow-status | app/property/escrow-status.tsx | Nobody in the live flow |
| Legal Contract (prototype) | /property/contract | app/property/contract.tsx | Anyone using the chat thread menu |
| Transaction Success receipt (prototype) | /property/receipt | app/property/receipt.tsx | Nobody in the live flow |
The live screen uses paymentApi in services/payment/payment-thunk.ts and the socket hook hooks/use-escrow-updates.ts.
Before you start
- Signed in as the buyer on the transaction. The backend looks the transaction up by id and buyer, so another user gets a not-found error.
- The live screen is opened by "Pay Now" on the payment screen in
ESCROWmode, with theidparam set to theescrowTransactionIdreturned byPOST /api/v1/escrow/initialize. See Paying for a property. - Reporting a payment opens the photo library. The app uses the system photo picker, which on current iOS and Android versions does not need a separate permission prompt.
- Releasing funds needs the OTP the escrow provider (Pandascrow) emails to the buyer.
No way back to an escrow from the profile
The cards under Profile, "Payment History" are not tappable, and "My Properties" opens the listing, not the escrow. The only code that opens the live escrow screen is "Pay Now" on the payment screen. Once the user leaves it there is no in-app route back to that transaction, and tapping "Pay Now" again starts a new escrow request. A tenant who needs to release funds later currently has no screen to do it from. Confirm with product whether a link is planned.
Flow
Viewing the escrow
- The screen fires
GET /api/v1/escrow/my/:idand caches the result inpaymentApiunder the tagEscrowwith this id. - It connects the socket and listens for
escrow:status_updated. An event for this transaction invalidates the cache entry, so the screen refetches without a pull to refresh. - The summary card shows the property title (or "Escrow Transaction"), a status pill with the raw status, the location, the amount in the transaction's currency, and "Ref:" with the transaction reference.
- "Transaction Journey" lists four steps. Their state follows the status:
| Step | Description shown | pending | funded | completed |
|---|---|---|---|---|
| Payment Initiated | "Escrow transaction has been created and is awaiting funding." | Done | Done | Done |
| Funds in Escrow | "Funds are held securely in escrow pending legal and property verification." | Waiting | Active | Done |
| Property Verification | "Physical key transfer, site walkthrough, and final sign-off." | Waiting | Waiting | Done |
| Funds Released | "Final disbursement of total funds to the seller's verified account." | Waiting | Waiting | Done |
For disputed or cancelled every step shows as waiting and no action button is offered.
5. A card names the seller with the label "Property Owner".
Funding a pending escrow
- While the status is
pendingand the transaction has apaymentUrl, "Fund Escrow Now" opens that URL in the device browser. Failure to open shows "Error" / "Could not open the payment page.". - The user pays on the provider's page and returns to the app. The status changes when the backend hears from the provider and emits
escrow:status_updated.
Reporting a payment that still shows pending
- "I Have Made Payment" opens the alert "Confirm Payment" / "Use this only if you've paid and the payment still shows as pending. You'll need to attach your receipt or a screenshot of the transfer." with "Cancel" and "Choose Receipt".
- "Choose Receipt" opens the photo library (images only, quality 0.8). Cancelling the picker ends the flow.
- After an image is chosen: "Send Proof of Payment" / "Your receipt will be sent to the property owner to verify the payment." with "Cancel" and "Send".
- "Send" fires
PATCH /api/v1/escrow/:id/payment-madeas multipart form data with one file field,proof(namedpayment-proof.pngfor a PNG, otherwisepayment-proof.jpg). - Success shows "Sent" / "Payment notification sent! Awaiting confirmation." and refetches. Failure shows "Error" with the server message or "Failed to notify payment. Please try again.".
Reporting a payment marks the escrow funded
The alert text says the owner will verify the payment, but the backend sets the escrow status to funded as soon as the proof is uploaded, as long as it was still pending. The tenant then sees "Mark Deal as Completed" straight away. A second report returns "Payment has already been confirmed for this escrow".
Completing the deal and releasing funds
- While the status is
funded, the button "Mark Deal as Completed" opens a bottom sheet titled "Confirm Deal Completion" with the warning "Confirm all property handover steps are complete before funds are released to the seller. This action cannot be undone.". - "Handover Checklist" has four checkboxes, all required:
- "Keys have been physically transferred to me"
- "House receipt / ownership document received"
- "Site walkthrough completed and property inspected"
- "Final agreement / deed of assignment signed"
- "Pandascrow OTP" is a numeric field (placeholder "Enter 6-digit OTP sent to your email", digits only, maximum 6). The app only requires it to be non-empty.
- "Resend OTP" fires
POST /api/v1/escrow/:id/resend-otp. Success shows "OTP Sent" / "A new OTP has been sent. Check your email." and the link becomes "Resend OTP in Ns", counting down from theretryAftervalue (60 seconds). A request made too early shows "Error" with "Please wait N seconds before requesting another OTP" and starts the countdown from the server's remaining time. - "Confirm & Release Funds" stays disabled until all four boxes are ticked and the OTP field has a value. It fires
PATCH /api/v1/escrow/:id/request-completionwith bodyotp. - Success shows "Escrow Completed" / "Escrow marked as completed. Funds will be released to the seller.", closes the sheet, resets the form and refetches. The actions area then reads "This transaction is complete. Funds have been released.".
- Failure (wrong OTP, escrow not funded) shows "Error" with the server message or "Failed to complete escrow. Please try again.". The sheet stays open.
- "Cancel" closes the sheet and clears the checklist and OTP.
Prototype screens
These three screens show fixed sample content (one sample property, sample names, sample amounts and dates). They call no API and take no params.
| Screen | What it shows | Controls that work | Controls with no handler |
|---|---|---|---|
/property/escrow-status | A three-step timeline: "Payment Received" (DONE), "Legal Validation" (ACTIVE) with a sample barrister, "Funds Release" | Back; "View Digital Contract" opens /property/contract; "Download Summary PDF" opens /property/receipt | Header icon, barrister contact icon |
/property/contract | "Legal Contract": a "Residential Property Agreement" summary, "Assigned Legal Witness" marked VERIFIED, and sections "Parties Involved", "Payment Terms", "Duration", "Obligations" | Back | Two header icons, "Download Official PDF", "Contact Legal Witness" |
/property/receipt | "Transaction Success": "Funds Released" with rows "Transaction ID", "Recipient", "Amount", "Date" | Back | "Share", "Download" |
How they are reached today:
/property/escrow-statusonly from the "Okay" button on the prototype "Make a Transfer" screen./property/contractfrom the prototype escrow status screen, and from the "Request Documents" item in the chat thread menu (tenant and agent threads). See Chats and notifications./property/receiptonly from the prototype escrow status screen.
Sample data shown to real users
The chat menu item opens the contract prototype for any conversation, so a real user can see a sample agreement with placeholder names and amounts that has nothing to do with their property. No real receipt or contract is generated by the app; "Download Summary PDF" does not download anything.
States and edge cases
- Loading. A centred spinner until the transaction loads.
- Transaction not found or request failed. There is no error view. The screen renders with the title "Escrow Transaction", no amount, the journey in its default state and no action buttons.
- Socket unavailable. The screen still works; status changes appear only after an action triggers a refetch or the screen is reopened.
- No
paymentUrlon a pending escrow. "Fund Escrow Now" is hidden; only "I Have Made Payment" shows. - Upload in progress. "I Have Made Payment" is dimmed and disabled, with a spinner.
- Proof upload fails on the server. "Could not upload the proof of payment. Please try again.".
- OTP requested for an escrow that is not funded. "An OTP can only be sent for a funded escrow".
- Session expired. A 401 triggers one silent token refresh; if that fails the app returns to sign in.
What happens next
- After a payment report. The backend stores the proof, sets the status to
funded, notifies the parties, and emitsescrow:status_updatedto the seller so an open agent dashboard updates live. - After completion. The backend sets the status to
completedwith a completion time, notifies the parties, and emitsescrow:status_updated. A rent transaction marks the propertyrented; a purchase marks itsold. Short-lets are left unchanged so other guests can still book. - Payout. The seller's net amount goes to their saved bank account; the platform fee and any agent commission are withheld by the escrow provider and the agent's share is forwarded when the escrow completes (per the comments in the backend escrow controller).
- In the app. The transaction's new status shows under Profile, "Payment History" and "My Properties" (labels "In escrow", "Completed"). See Profile and settings.
HomeLink Hub