Earnings and Payouts
What the Earnings screen shows, where the payout bank account is validated, and which wallet and withdrawal features are not in the mobile app.
The mobile app gives agents and landlords a read-only view of what they have earned. The payout bank account is captured and validated once, during agent setup. Wallet balances, withdrawals and payout history exist in the backend but have no mobile screens.
Where it lives
| Screen | Route | File | Who sees it |
|---|---|---|---|
| Earnings | /(tabs)/earnings (pushed as /earnings) | app/(tabs)/earnings.tsx | Anyone in the (tabs) navigator, opened from Profile |
| Profile, Business section | /(tabs)/profile | app/(tabs)/profile/index.tsx | Entry point: Earnings row |
| Payment Details step (bank validation) | /agent-onboarding (step 4 of 5) | components/onboarding/step-bank-details.tsx | Agents during setup |
Supporting code: services/earnings/earnings-api.ts (RTK Query slice earningsApi, tag Earnings), hooks/use-bank-account-verification.ts, lib/bank-account.ts.
Before you start
- Signed in with a role that lands in
(tabs).earningsis registered withhref: null, so it has no tab bar icon; it is opened from Profile, then Business, then Earnings ("What you have earned and what is in escrow"). - The Profile row is not role-gated in code, so a lawyer also sees it. The data only makes sense for agents and landlords.
- Nothing is earned until a buyer or tenant has paid: rows come from escrow transactions where the user is the seller, paid inspection fees, and agent commissions on completed purchases.
Flow
View earnings
-
From Profile, tap Earnings. The screen shows a back chevron and the title Earnings.
-
One request fires:
GET /api/v1/earnings?page=1&limit=50. The responsedata(summary,transactions,pagination) is cached by RTK Query. Nothing is written to AsyncStorage. -
The summary block is rendered from
summary:UI label Field Caption Total earned totalNet"From n transactions, after platform fees" (uses completedCount; singular "transaction" when it is 1)In escrow pendingNet"Not yet released" This month thisMonthNet"Net earned" Gross received totalGrossPlatform fees totalPlatformFeesshown with a leading minus sign Your earnings totalNet -
Amounts are formatted as currency in the
en-NGlocale with no decimals, usingsummary.currency(defaultNGN). -
Under the heading Transactions, each row shows:
- Property title, or "Property removed" when the property no longer exists.
- A status badge (see below).
- "community, state" when available.
- You receive with
netAmount. - "Buyer paid" with
grossAmount, "fee" withplatformFee, and the date (completedAt, elsecreatedAt, asMMM D, YYYY).
-
Rows are not tappable. There is no detail screen, filter, or paging; only the first 50 transactions are loaded.
-
Pull down to refetch.
Status badges
Transaction status | Badge label | Notes |
|---|---|---|
pending | Pending | Escrow transaction not yet funded |
funded | In escrow | Paid into escrow, not yet released. Paid inspection fees also report as funded until the inspection is completed |
completed | Paid out | Only these rows count toward Gross received, Platform fees and the transaction count |
disputed | Disputed | |
cancelled | Cancelled |
The mobile types have drifted from the backend response
services/earnings/earnings-api.ts describes an older response shape than the one service/src/controllers/earnings.controller.ts returns today. The differences below change what the screen shows.
- The backend sends the other party as
counterparty, but the row readsbuyer, so the buyer's name line never renders. summary.netIsDerivedis no longer returned, so the note "Fees are calculated from current platform rates and may differ slightly for older transactions." never appears.- The backend also returns a
walletobject (available, withdrawn, processing, pending) and a per-rowpayoutobject with the bank transfer state. The mobile screen ignores both. The Paid out badge is driven by the transaction beingcompleted, not by an actual transfer having been made. - Inspection fees and agent commissions are in the same feed. They are labelled "Buyer paid" like property sales, with a fee of zero.
Bank account validation (agent setup only)
The only place the mobile app collects and validates a payout account is the Payment Details step of agent setup. The full step is documented in Agent onboarding and KYC; the validation mechanics are:
-
The step loads the bank list with
GET /api/v1/user/banks. While it loads the field shows "Loading banks…". The agent picks a bank from the Select your bank sheet (with a Search banks box; "No banks found." when nothing matches). -
Account number accepts digits only and is cut to 10 characters.
-
As soon as a bank is chosen and the number is exactly 10 digits, the hook waits 500 ms and fires
POST /api/v1/user/bank-details/verifywithaccountNumberandbankCode. The holder field shows "Confirming with your bank…". -
On success the returned name fills the read-only Account holder name field and a green tick appears. Changing the bank or the number clears the name and verifies again.
-
On failure the field error shows the server message, or "We could not confirm this account. Check the number and bank.".
-
Field rules from
lib/bank-account.ts:Field Rule Message Bank name Required "Select your bank." Account number Required "Enter your account number." Account number Exactly 10 digits "Account number must be exactly 10 digits." Account number Must be verified when the bank list loaded "We could not confirm this account. Check the number and bank." Account holder name Required "Account holder name is filled in once your account is verified." (or "Enter the name on the account." in fallback mode) SWIFT / IBAN (optional) 8 to 34 letters or digits "Enter 8-34 letters or digits, with no spaces." -
Saving the step fires
PUT /api/v1/user/bank-details. A failed validation shows the toast "Please fix the highlighted bank details.". -
If the bank list cannot be loaded, the step falls back to plain text inputs with no verification, so setup is never blocked.
No way to change the bank account after setup
The Profile screens for agents and landlords (app/(tabs)/profile/**) have no bank details screen. After setup, the saved account can only be changed outside the mobile app.
What is not available on mobile
Wallet, withdraw and payouts have no mobile screens
The backend exposes a full wallet and payout API in service/src/routes/earnings.routes.ts, but the mobile app calls none of it. Only GET /api/v1/earnings is used. An agent who needs to withdraw or track a payout must do it outside the mobile app.
| Backend endpoint | Purpose | Mobile app |
|---|---|---|
GET /api/v1/earnings/wallet | Available, held and withdrawn balance | Not used |
GET /api/v1/earnings/banks | Bank list for payouts | Not used (setup uses GET /api/v1/user/banks) |
POST /api/v1/earnings/banks/validate | Validate a payout account | Not used (setup uses POST /api/v1/user/bank-details/verify) |
POST /api/v1/earnings/withdraw | Withdraw from the wallet | Not used |
POST /api/v1/earnings/:id/dispatch | Send one earning to the bank | Not used |
GET /api/v1/earnings/payouts | Payout history | Not used |
There is also no seller-side escrow screen. Marking a payment as made, the release OTP and escrow completion are all on the buyer's screen (app/property/escrow/[id].tsx) in the tenant flow.
States and edge cases
| Situation | What the user sees |
|---|---|
| First load | Centred spinner; no summary block until data arrives |
| Request failed | Alert icon, "Couldn't load earnings" and Try again. The summary block is hidden |
| No transactions | Summary block with zero amounts, then "No Earnings Yet" / "Completed bookings and sales will show up here." |
| Unknown status value | Raw status string in a grey badge |
| Non-numeric amount | Formatted as zero |
| Session expired | The shared base query refreshes the token once, then signs the user out to /(auth)/signin if that fails |
What happens next
Nothing on the Earnings screen changes server state. Totals move when the backend completes an escrow transaction or an inspection, and the screen picks that up on the next open or pull to refresh. There is no socket subscription on this screen.