Customer
This section covers the API endpoints for managing customers in the admin panel.
List Customers
GET /v1/admin/customers
Returns a paginated list of all customers.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
search_text | string | Search customers by username, email, full name, phone or country name |
filter[role_name] | string | Filter by customer role |
filter[customer_level] | string | Filter by customer level |
filter[gar_type] | string | Filter by GAR type |
filter[country] | string | Filter by country |
filter[created_at] | string | Filter by creation date range |
filter[email_verified] | boolean | Filter by email verification status |
filter[trashed] | boolean | Include trashed customers |
sort | string | Sort by field (prefix with - for descending) |
per_page | integer | Number of items per page. Defaults to 10 |
list | boolean | Return simplified list format |
Response
{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"current_page": 1,
"first_page_url": "http://192.168.0.139:8080/v1/admin/customers?page=1",
"from": 1,
"last_page": 18440,
"last_page_url": "http://192.168.0.139:8080/v1/admin/customers?page=18440",
"links": [
{
"url": null,
"label": "« السابق",
"active": false
},
{
"url": "http://192.168.0.139:8080/v1/admin/customers?page=1",
"label": "1",
"active": true
},
{
"url": "http://192.168.0.139:8080/v1/admin/customers?page=2",
"label": "2",
"active": false
},
{
"url": "http://192.168.0.139:8080/v1/admin/customers?page=3",
"label": "3",
"active": false
},
{
"url": null,
"label": "...",
"active": false
},
{
"url": "http://192.168.0.139:8080/v1/admin/customers?page=18439",
"label": "18439",
"active": false
},
{
"url": "http://192.168.0.139:8080/v1/admin/customers?page=18440",
"label": "18440",
"active": false
},
{
"url": "http://192.168.0.139:8080/v1/admin/customers?page=2",
"label": "التالي »",
"active": false
}
],
"next_page_url": "http://192.168.0.139:8080/v1/admin/customers?page=2",
"path": "http://192.168.0.139:8080/v1/admin/customers",
"per_page": 10,
"prev_page_url": null,
"to": 10,
"total": 184391,
"customers": [
{
"id": "9f2ecd22-5c07-48ec-9415-2979deec4493",
"username": "wotname",
"first_name": null,
"last_name": null,
"full_name": "Hamad Alshabanah",
"email": "developer@sumaya369.net",
"join_date": "2025-01-01",
"created_at": "2025-01-01 00:00:00",
"country": "السعودية",
"email_verified": "مفعل بتاريخ 2022-04-18",
"avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"role": "affiliate_marketer",
"customer_level": "نقاطي",
"gar_type": null
},
{
"id": "f9d7f483-17a2-4572-999d-8a377f875e58",
"username": "nujud.mubarak",
"first_name": null,
"last_name": null,
"full_name": "Nujud Mubarak",
"email": "nujud@sumaya369.net",
"join_date": "2025-01-01",
"created_at": "2025-01-01 00:00:00",
"country": "السعودية",
"email_verified": "مفعل بتاريخ 2022-08-03",
"avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"role": "customer",
"customer_level": "نقاطي",
"gar_type": null
},
{
"id": "6f78a071-d19f-4b37-8c1e-ba375c091021",
"username": "sara-sd",
"first_name": null,
"last_name": null,
"full_name": "Sara Sultan",
"email": "sara-s-d@hotmail.com",
"join_date": "2025-01-01",
"created_at": "2025-01-01 00:00:00",
"country": "السعودية",
"email_verified": "غير مفعل",
"avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"role": "customer",
"customer_level": "نقاطي",
"gar_type": null
},
{
"id": "aca71bd0-9c12-4279-9e9e-33e1b5bf00de",
"username": "bootfi_admin",
"first_name": null,
"last_name": null,
"full_name": "Mohammed Bootfi",
"email": "mohammed@bootfi.com",
"join_date": "2025-01-01",
"created_at": "2025-01-01 00:00:00",
"country": "اليمن",
"email_verified": "مفعل بتاريخ 2022-08-28",
"avatar": "http://192.168.0.139:8000/storage/21936/scene06849.png",
"role": "customer",
"customer_level": "نقاطي",
"gar_type": null
}
]
},
"status_code": 200
}
Create Customer
POST /v1/admin/customers
Create a new customer.
Request Body
| Parameter | Type | Description |
|---|---|---|
username | string | Required. Username (3-16 characters) |
first_name | string | Required. First name (3-32 characters, alpha only) |
last_name | string | Required. Last name (3-32 characters, alpha only) |
email | string | Required. Valid email address (3-64 characters) |
password | string | Required. Password (5-32 characters) |
password_confirmation | string | Required. Must match password |
gender | string | Required. Either 'FEMALE' or 'MALE' |
birth | string | Required. Date format: Y-m-d (must be 13+ years old) |
phone | string | Required. Phone number (7-15 digits) |
country_id | string | Required. Valid country ID |
avatar | file | Optional. Image file (jpeg/png/jpg, 25KB-1MB) |
Response
//Route doesn't work
Get Customer
GET /v1/admin/customers/{id}
Retrieve details of a specific customer.
Response
{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"id": "9f2ecd22-5c07-48ec-9415-2979deec4493",
"username": "wotname",
"first_name": "Hamad",
"last_name": "Alshabanah",
"full_name": "Hamad Alshabanah",
"email": "developer@sumaya369.net",
"gender": "انثى",
"birth_day": "1993-05-15",
"phone": "501968815",
"activation_url": "/auth/activate-account/token/?token=&email=developer@sumaya369.net",
"country_id": "18e1ceab-f28a-4fcc-929f-526b8f6e1557",
"country": "السعودية",
"blocked_at": null,
"role_updated_at": "2022-10-25 00:00:00",
"if_blocked": "حساب فعال",
"phone_code": "+966",
"avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"role": "affiliate_marketer",
"affiliate_percentage": "4.00",
"affiliated_all_items": true,
"affiliate_active": true,
"can_access_reduced_price": true,
"join_date": "2025-01-01",
"email_verified": "مفعل بتاريخ 2022-04-18",
"orders_count": 121,
"subscriptions_count": 123,
"comments_count": 2,
"favorites_count": 0,
"cart_count": 0,
"points_count": 5,
"rates_count": 1,
"activities_count": 1,
"login_histories_count": 7,
"affiliated_items_count": 39,
"affiliated_sales_count": 0,
"affiliated_payments_count": 0,
"trengo_messages_count": 7,
"desires_count": 0,
"is_marketer": true,
"points_sum": 5,
"level_name": "نقاطي",
"gar_type": null,
"social_media": {
"facebook": {
"username": null,
"status": null
},
"tiktok": {
"username": "null",
"status": "verifing"
},
"instagram": {
"username": "null",
"status": "verifing"
},
"twitter": {
"username": "null",
"status": "verifing"
}
}
},
"status_code": 200
}
Update Customer
PATCH /v1/admin/customers/{id}
Update an existing customer.
Request Body
| Parameter | Type | Description |
|---|---|---|
username | string | Optional. Username (3-16 characters) |
first_name | string | Optional. First name (3-32 characters, alpha only) |
last_name | string | Optional. Last name (3-32 characters, alpha only) |
email | string | Optional. Valid email address (3-64 characters) |
password | string | Optional. Password (5-32 characters) |
gender | string | Optional. Either 'FEMALE' or 'MALE' |
birth | string | Optional. Date format: Y-m-d (must be 13+ years old) |
phone | string | Optional. Phone number (7-15 digits) |
country_id | string | Optional. Valid country ID |
avatar | file | Optional. Image file (jpeg/png/jpg, 25KB-1MB) |
role | string | Optional. Either 'customer' or 'affiliate_marketer' |
is_blocked | boolean | Optional. Block/unblock customer |
facebook | string | Optional. Facebook account status |
twitter | string | Optional. Twitter account status |
instagram | string | Optional. Instagram account status |
tiktok | string | Optional. TikTok account status |
Response
{
"success": true,
"message": "تم تحديث البيانات بنجاح.",
"data": {
"id": "df5323f6-3891-4337-978a-94ef244c82c5",
"username": "aalbaiti360",
"first_name": "",
"last_name": "",
"full_name": "اسم العميل",
"email": "aalbaiti360@gmail.com",
"gender": null,
"birth_day": null,
"phone": null,
"activation_url": "/auth/activate-account/token/?token=1949&email=aalbaiti360@gmail.com",
"country_id": "18e1ceab-f28a-4fcc-929f-526b8f6e1557",
"country": "السعودية",
"blocked_at": null,
"role_updated_at": null,
"if_blocked": "حساب فعال",
"phone_code": "+966",
"avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"role": "customer",
"affiliate_percentage": "0.00",
"affiliated_all_items": false,
"affiliate_active": true,
"can_access_reduced_price": "true",
"join_date": "2021-11-09",
"email_verified": "غير مفعل",
"orders_count": 1,
"subscriptions_count": 0,
"comments_count": 0,
"favorites_count": 0,
"cart_count": 0,
"points_count": 1,
"rates_count": 1,
"activities_count": 8,
"login_histories_count": 3,
"affiliated_items_count": 0,
"affiliated_sales_count": 0,
"affiliated_payments_count": 0,
"trengo_messages_count": 0,
"desires_count": 0,
"is_marketer": false,
"points_sum": 20,
"level_name": "نقاطي",
"gar_type": null,
"social_media": {
"facebook": {
"username": null,
"status": null
},
"tiktok": {
"username": null,
"status": null
},
"instagram": {
"username": null,
"status": null
},
"twitter": {
"username": null,
"status": null
}
}
},
"status_code": 200
}
Delete Customers
DELETE /v1/admin/customers
Delete one or more customers.
Request Body
| Parameter | Type | Description |
|---|---|---|
ids | array | Required. Array of customer UUIDs to delete |
ids.* | string | Required. UUID format |
confirm_deletion | boolean | Optional. Force delete customer |
Response
{
"success": true,
"message": "تم حذف البيانات بنجاح.",
"data": null,
"status_code": 200
}
Update Customer Password
PATCH /v1/admin/update-customer-password/{id}/
Update a customer's password. If no password is provided, a random 10-character password will be generated and sent to the customer's email.
Request Body
| Parameter | Type | Description |
|---|---|---|
password | string | Optional. New password (min 6 characters) |
Response
{
"success": true,
"message": "تمت إعادة تعيين كلمة المرور بنجاح",
"data": null,
"status_code": 200
}
Invite Customer
POST /v1/admin/customers/email-invitation
Send an invitation email to a potential customer.
Request Body
| Parameter | Type | Description |
|---|---|---|
username | string | Required. Username (3-32 characters) |
email | string | Required. Valid email address (max 64 characters) |
Response
{
"success": true,
"message": "تم ارسال الدعوة للعميل بنجاح.",
"data": null,
"status_code": 200
}
Batch Update Customers
PATCH /v1/admin/customers
Update multiple customers at once.
Request Body
| Parameter | Type | Description |
|---|---|---|
ids | array | Required. Array of customer UUIDs |
ids.* | string | Required. UUID format |
rest_password | boolean | Optional. Reset passwords for selected customers |
restore | boolean | Optional. Restore deleted customers |
Response
{
"success": true,
"message": "تم تحديث البيانات بنجاح.",
"data": null,
"status_code": 200
}
Customer Statistics
GET /v1/admin/statistics/customers
Get customer statistics and analytics.
Response
{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"total_customers": "184.6K",
"activated_customers_chart": [
[
"active",
"184.6K"
],
[
"unactive",
"0"
]
],
"activated_customers": "184.6K",
"subscribed_customers_chart": [
[
"subscribed",
"84.6K"
],
[
"not_subscribed",
"99.8K"
]
],
"subscribed_customers": "84.6K",
"customers_countries": [
{
"name": "السعودية",
"percentage": "120.2K%"
},
{
"name": "العراق",
"percentage": "8.6K%"
},
{
"name": "الإمارات",
"percentage": "7.7K%"
},
{
"name": "الجزائر",
"percentage": "6K%"
}
]
},
"status_code": 200
}
Logout Customer Devices
POST /v1/admin/customer-logout-devices/{id}
Log out a customer from all their devices by removing access tokens and device records.
Response
{
"success": true,
"message": "تم تسجيل خروج العميل من جميع الاجهزة بنجاح.",
"data": null,
"status_code": 200
}
Get Selected Customers
GET /v1/admin/selected-customers
Retrieve details for a specific set of customers.
Request Body
| Parameter | Type | Description |
|---|---|---|
ids | array | Required. Array of customer UUIDs |
Response
{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"customers": [
{
"id": "df5323f6-3891-4337-978a-94ef244c82c5",
"username": "aalbaiti360",
"first_name": "",
"last_name": "",
"full_name": "اسم العميل",
"email": "aalbaiti360@gmail.com",
"join_date": "2021-11-09",
"created_at": "2021-11-09 11:45:10",
"country": "السعودية",
"email_verified": "غير مفعل",
"avatar": "https://i.ibb.co/YhTw0wR/7-512.png",
"role": "customer",
"customer_level": "نقاطي",
"gar_type": null
}
]
},
"status_code": 200
}
Export Customer Points
GET /v1/admin/customers/points-export
Export customer points data to an Excel file.
Response
Downloads a file named "Customer-Points.xlsx" containing customer points data.
Import Reduced Price Customers
POST /v1/admin/customers/import-reduced-price
Import a list of customers who will have access to reduced prices.
Request Body
| Parameter | Type | Description |
|---|---|---|
emails | file | Required. Excel file containing customer email addresses |
Response
{
"success": true,
"message": "تم حفظ البيانات بنجاح.",
"data": null,
"status_code": 200
}
Check If Can Force Delete
GET /v1/admin/customers-force-delete/{id}
Check if a customer can be force deleted from the system.
Response
{
"success": false,
"message": "لا يمكنك الحدف",
"errors": null,
"data": {
"comments_count": 2,
"rates_count": 1,
"devices_count": 0,
"notes_count": 1,
"favorites_count": 0,
"discounts_count": 7,
"orders_count": 121,
"subscriptions_count": 123,
"notifications_count": 187,
"can_deleted": false
},
"status_code": 422
}
Authorization
All customer management endpoints require admin authorization. The user must have the appropriate permissions to perform these operations.
Notes
- Username and email must be unique across all customers
- First name and last name must contain only alphabetic characters
- Birth date must be for customers 13 years or older
- Password changes will trigger an email notification to the customer
- Avatar images must be between 25KB and 1MB in size
- Phone numbers must be valid for the selected country