Skip to main content

Get Passenger Wallets

Retrieve a paginated list of all passenger wallets with optional currency filtering.
This endpoint requires admin authorization.
GET /api/admin/wallets/passengers

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 passenger wallet items
totalCount
integer
Total number of passenger 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/passengers?currency=SAR&page=1&pageSize=20" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN"

Example Response

{
  "wallets": [
    {
      "userId": "passenger_456",
      "name": "فاطمة علي",
      "phoneNumber": "+966507654321",
      "currency": "SAR",
      "walletBalance": 350.75,
      "lastUpdatedAt": "2026-03-10T09:15:00Z"
    }
  ],
  "totalCount": 120,
  "page": 1,
  "pageSize": 20,
  "totalPages": 6
}

Deposit to Passenger Wallet

Add funds to a passenger’s wallet (admin operation).
POST /api/admin/passengers/{passengerId}/wallet/deposit

Path Parameters

passengerId
string
required
The passenger’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
Passenger’s new wallet balance after deposit

Example Request

curl -X POST "https://api.masareagle.sa/api/admin/passengers/passenger_456/wallet/deposit" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 200.00,
    "currency": "SAR",
    "transferReference": "REF20260310123",
    "notes": "Refund for cancelled trip"
  }'

Example Response

{
  "success": true,
  "message": "تم إيداع 200.00 SAR بنجاح",
  "newBalance": 550.75
}
A wallet deposit notification is automatically sent to the passenger upon successful deposit. The transaction is recorded with admin as the performer.

Transaction Details

Each deposit creates a wallet transaction record with:
  • Transaction Type: Deposit
  • Reference Type: Transfer
  • Performed By: Admin user ID
  • Notes: Admin-provided notes or default message

Error Handling

{
  "success": false,
  "message": "محفظة الراكب غير موجودة",
  "newBalance": null
}
Passenger wallets are automatically created when they book their first trip. If a wallet doesn’t exist, the deposit operation will fail.

Build docs developers (and LLMs) love