Skip to main content

Wallets

This guide explains how to interact with the wallets API endpoints in the Calwe application.

Get Wallet History

Endpoint

  • Method: GET
  • URL: /v1/wallets

Request Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
Acceptapplication/jsonYes
AuthorizationBearer tokenYes

Query Parameters

ParameterTypeDescriptionRequiredDefault
per_pageintegerNumber of items per pageNo12

Success Response

{
"success": true,
"message": "تم جلب البيانات بنجاح",
"data": {
"walletHistories": [
{
"number": "TRX-123456",
"amount": 100.00,
"type": "إيداع",
"notes": "Payment for session",
"created_at": "2024-03-20 10:30:00"
},
{
"number": "TRX-123457",
"amount": -50.00,
"type": "سحب",
"notes": "Withdrawal to bank account",
"created_at": "2024-03-19 15:45:00"
}
],
"total_balance": "150.00 ر.س",
"pagination": {
"currentPage": 1,
"lastPage": 10,
"perPage": 12,
"total": 120
}
},
"statusCode": 200
}

Transaction Types

TypeDescriptionArabic Description
DEPOSITMoney added to walletإيداع
WITHDRAWALMoney removed from walletسحب
REFUNDEDRefund transactionمسترد

Error Responses

Unauthorized Error (401)

{
"success": false,
"message": "يجب عليك تسجيل الدخول",
"data": [],
"statusCode": 401
}

Important Notes

  • All amounts are in Saudi Riyals (ر.س)
  • Transactions are ordered by creation date (newest first)
  • The total balance shows the current wallet balance
  • Transaction types are displayed in Arabic
  • Each transaction includes:
    • Transaction number
    • Amount (positive for deposits, negative for withdrawals)
    • Transaction type
    • Notes (if any)
    • Creation date and time