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
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
| Authorization | Bearer token | Yes |
Query Parameters
| Parameter | Type | Description | Required | Default |
|---|---|---|---|---|
| per_page | integer | Number of items per page | No | 12 |
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
| Type | Description | Arabic Description |
|---|---|---|
| DEPOSIT | Money added to wallet | إيداع |
| WITHDRAWAL | Money removed from wallet | سحب |
| REFUNDED | Refund 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