Skip to main content

Get Driver Wallets

Retrieve a paginated list of all driver wallets with optional currency filtering.
This endpoint requires admin authorization. Only non-company drivers are included in results.
GET /api/admin/wallets/drivers

Query Parameters

currency
string
Filter wallets by currency code (e.g., SAR, EGP) or symbol. Optional.
page
integer
default:"1"
Page number for pagination. Must be greater than 0.
pageSize
integer
default:"20"
Number of items per page. Must be between 1 and 100.

Response Fields

wallets
array
Array of driver wallet items
totalCount
integer
Total number of driver wallets matching the filter
page
integer
Current page number
pageSize
integer
Items per page
totalPages
integer
Total pages available

Example Request

curl -X GET "https://api.masareagle.sa/api/admin/wallets/drivers?currency=SAR&page=1&pageSize=20" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN"

Example Response

{
  "wallets": [
    {
      "userId": "driver_123",
      "name": "أحمد محمد",
      "phoneNumber": "+966501234567",
      "currency": "SAR",
      "walletBalance": 1250.50,
      "totalEarnings": 15000.00,
      "totalCommission": 1500.00,
      "netProfit": 13500.00,
      "lastUpdatedAt": "2026-03-10T10:30:00Z"
    }
  ],
  "totalCount": 45,
  "page": 1,
  "pageSize": 20,
  "totalPages": 3
}

Deposit to Driver Wallet

Add funds to a driver’s wallet (admin operation).
POST /api/admin/drivers/{driverId}/wallet/deposit

Path Parameters

driverId
string
required
The driver’s unique user ID

Request Body

amount
decimal
required
Amount to deposit. Must be positive.
currency
string
required
Currency code (SAR, EGP, etc.) or symbol
transferReference
string
Optional bank transfer or transaction reference number
notes
string
Optional admin notes for this deposit

Response Fields

success
boolean
required
Indicates if deposit was successful
message
string
required
Success or error message in Arabic
newBalance
decimal
Driver’s new wallet balance after deposit

Example Request

curl -X POST "https://api.masareagle.sa/api/admin/drivers/driver_123/wallet/deposit" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 500.00,
    "currency": "SAR",
    "transferReference": "TRF20260310001",
    "notes": "Monthly bonus payment"
  }'

Example Response

{
  "success": true,
  "message": "تم إيداع 500.00 SAR بنجاح",
  "newBalance": 1750.50
}
A wallet deposit notification is automatically sent to the driver upon successful deposit.

Withdraw from Driver Wallet

Withdraw funds from a driver’s wallet (admin operation).
POST /api/admin/drivers/{driverId}/wallet/withdraw

Path Parameters

driverId
string
required
The driver’s unique user ID

Request Body

amount
decimal
required
Amount to withdraw. Must be positive and not exceed wallet balance.
currency
string
required
Currency code (SAR, EGP, etc.) or symbol
transferReference
string
Optional bank transfer or transaction reference number
notes
string
Optional admin notes for this withdrawal

Response Fields

success
boolean
required
Indicates if withdrawal was successful
message
string
required
Success or error message in Arabic
newBalance
decimal
Driver’s new wallet balance after withdrawal

Example Request

curl -X POST "https://api.masareagle.sa/api/admin/drivers/driver_123/wallet/withdraw" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 1000.00,
    "currency": "SAR",
    "transferReference": "WD20260310001",
    "notes": "Driver withdrawal request"
  }'

Example Response

{
  "success": true,
  "message": "تم سحب 1000.00 SAR بنجاح",
  "newBalance": 750.50
}

Error Response

{
  "success": false,
  "message": "رصيد غير كافي",
  "newBalance": null
}
Withdrawals will fail if the amount exceeds the available wallet balance. A withdrawal notification is sent to the driver upon success.

Build docs developers (and LLMs) love