Points
This section covers the API endpoints for managing points in the admin panel.
List Points
GET /v1/admin/points
Returns a paginated list of all points.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
search_text | string | Search points by name |
per_page | integer | Number of items per page. Defaults to 10 |
Response
{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"current_page": 1,
"first_page_url": "http://192.168.0.139:8080/v1/admin/settings/points?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://192.168.0.139:8080/v1/admin/settings/points?page=1",
"links": [
{
"url": null,
"label": "« السابق",
"active": false
},
{
"url": "http://192.168.0.139:8080/v1/admin/settings/points?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "التالي »",
"active": false
}
],
"next_page_url": null,
"path": "http://192.168.0.139:8080/v1/admin/settings/points",
"per_page": 10,
"prev_page_url": null,
"to": 3,
"total": 3,
"points": [
{
"id": "60df038d-9273-4f8b-a2e6-bdf961a445e8",
"icon": "green",
"name": "نقاط اشتراك",
"cause": "الاشتراك في مادة",
"message": "تم منحك نقاط جديدة : اشتراك في مادة",
"active": false,
"points": "+0"
},
{
"id": "ed82ae07-b99e-4cd7-8d17-b8479fa81e0b",
"icon": "white",
"name": "نقاط الطلب",
"cause": "طلب جديد",
"message": "اكتساب نقاط من الطلب: رقم_الطلب",
"active": false,
"points": "+0"
},
{
"id": "19978684-6e71-409a-8f60-4e5f4b4be45f",
"icon": "red",
"name": "نقاط الخصم",
"cause": "انتهاء صلاحية نقاطك",
"message": "انتهاء صلاحيـة النقاط",
"active": false,
"points": "+0"
}
]
},
"status_code": 200
}
Update Point
PATCH /v1/admin/points/{id}
Update an existing point.
Request Body
| Parameter | Type | Description |
|---|---|---|
points | integer | The amount of points |
Response
{
"success": true,
"message": "تم تحديث البيانات بنجاح.",
"data": {
"id": "60df038d-9273-4f8b-a2e6-bdf961a445e8",
"icon": "blue",
"name": "wow",
"cause": "الاشتراك في مادة",
"message": "سلامٌ",
"active": false,
"points": "+0"
},
"status_code": 200
}
Authorization
All points endpoints require admin authorization. The user must have the appropriate permissions to perform these operations.
Notes
- Points with amount of 0 cannot have their amounts be updated
- The system uses points for various reward and discount calculations