Skip to main content

Get Company Wallets

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

Query Parameters

currency
string
Filter wallets by currency code (e.g., SAR, EGP) or symbol. Optional.
page
integer
default:"1"
Page number for pagination. Automatically adjusted to 1 if less than 1.
pageSize
integer
default:"20"
Number of items per page. Must be between 1 and 100 (defaults to 20 if outside range).

Response Fields

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

Example Response

{
  "wallets": [
    {
      "companyId": "company_789",
      "companyName": "شركة النقل الحديث",
      "logoUrl": "https://storage.masareagle.sa/logos/company_789.png",
      "currency": "SAR",
      "walletBalance": 45000.00,
      "totalEarnings": 250000.00,
      "totalCommission": 25000.00,
      "netProfit": 225000.00,
      "totalDeposits": 50000.00,
      "totalWithdrawals": 30000.00,
      "lastUpdatedAt": "2026-03-10T11:00:00Z"
    }
  ],
  "totalCount": 15,
  "page": 1,
  "pageSize": 20,
  "totalPages": 1
}

Get Company Wallet Transactions

Retrieve paginated transaction history for a specific company wallet.
GET /api/admin/wallets/companies/{companyId}/transactions

Path Parameters

companyId
string
required
The company’s unique ID

Query Parameters

currency
string
required
Currency code for the wallet (SAR, EGP, etc.)
page
integer
default:"1"
Page number for pagination
pageSize
integer
default:"10"
Number of transactions per page (1-100)

Response Fields

transactions
array
Array of wallet transactions
totalCount
integer
Total number of transactions
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/companies/company_789/transactions?currency=SAR&page=1&pageSize=10" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN"

Example Response

{
  "transactions": [
    {
      "id": "tx_abc123",
      "transactionType": "Settlement",
      "transactionTypeDisplay": "إيداع إيرادات حجز",
      "amount": 500.00,
      "balanceBefore": 44500.00,
      "balanceAfter": 45000.00,
      "referenceId": "booking_xyz",
      "referenceType": "Booking",
      "performedBy": "system",
      "performedByType": "System",
      "notes": "Booking revenue settlement",
      "bankTransferReference": null,
      "createdAtUtc": "2026-03-10T11:00:00Z",
      "currency": "SAR"
    }
  ],
  "totalCount": 150,
  "page": 1,
  "pageSize": 10,
  "totalPages": 15
}

Transaction Types

TypeArabic DisplayDescription
DepositإيداعManual deposit by admin
WithdrawسحبManual withdrawal by admin
Deductخصم عمولةCommission deduction
Addإضافة من حجزEarnings from booking
RefundاسترجاعRefund to company
CommissionعمولةCommission transaction
Settlementإيداع إيرادات حجزBooking revenue settlement

Deposit to Company Wallet

Add funds to a company’s wallet (admin operation).
POST /api/admin/companies/{companyId}/wallet/deposit

Path Parameters

companyId
string
required
The company’s unique 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
Company’s new wallet balance after deposit

Example Request

curl -X POST "https://api.masareagle.sa/api/admin/companies/company_789/wallet/deposit" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 10000.00,
    "currency": "SAR",
    "transferReference": "COMP-DEP-20260310",
    "notes": "Initial balance deposit"
  }'

Example Response

{
  "success": true,
  "message": "تم إيداع 10000.00 SAR بنجاح",
  "newBalance": 55000.00
}
Company wallets are auto-created if they don’t exist. A notification is sent to the company upon successful deposit.

Withdraw from Company Wallet

Withdraw funds from a company’s wallet (admin operation).
POST /api/admin/companies/{companyId}/wallet/withdraw

Path Parameters

companyId
string
required
The company’s unique 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
Company’s new wallet balance after withdrawal

Example Request

curl -X POST "https://api.masareagle.sa/api/admin/companies/company_789/wallet/withdraw" \
  -H "Authorization: Bearer YOUR_ADMIN_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 5000.00,
    "currency": "SAR",
    "transferReference": "COMP-WD-20260310",
    "notes": "Company withdrawal request"
  }'

Example Response

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

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 company upon success.

Build docs developers (and LLMs) love