Skip to Content
HomeLink Hub
Admin

Get platform earnings

GET
/api/v1/admin/earnings

Access: Bearer token required. Roles: ADMIN.

Platform revenue overview. wallet is the platform ledger: earned.escrowFees is the sum of platformFee over completed escrows and totalEarned equals it; earned.inspectionFees is the inspection part of that figure, reported as a breakdown and not added again. pending is the fee on escrows still pending or funded; withdrawn is the total of platform payouts with status success; processing is platform payouts still pending or processing; available = max(totalEarned - withdrawn - processing, 0). currency is always NGN. revenueTrend always has 12 entries (JAN to DEC) for completed escrows created in the current UTC year. byTransactionType groups all completed escrows by transactionType (rent, purchase, inspection). payoutAccount is the configured platform bank account with the number masked to its last four digits, or null when none is set.

Authorization

bearerAuth
headerAuthorizationBearer <JWT>

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

Response Body

Earnings summary (revenueTrend trimmed to one of its 12 months)

application/json
  1. response
status*integer
success*boolean
message*string
data*
Example Request
curl -X GET 'http://localhost:4000/api/v1/admin/earnings'
Example Response
{  "status": 200,  "success": true,  "message": "Platform earnings fetched successfully",  "data": {    "wallet": {      "currency": "NGN",      "earned": {        "escrowFees": 6450000,        "inspectionFees": 185000      },      "totalEarned": 6450000,      "pending": 320000,      "withdrawn": 4000000,      "processing": 0,      "available": 2450000    },    "revenueTrend": [      {        "month": "JAN",        "fees": 540000,        "volume": 54000000,        "count": 12      }    ],    "byTransactionType": [      {        "type": "rent",        "fees": 4100000,        "volume": 410000000,        "count": 96      }    ],    "payoutAccount": {      "bankName": "Guaranty Trust Bank",      "bankCode": "058",      "accountName": "HOMELINK HUB LIMITED",      "accountNumberMasked": "••••6789"    }  }}