Gifts
This section covers the API endpoints for managing gifts in the admin panel.
List Gifts
GET /v1/admin/gifts
Returns a list of gifts with pagination support.
Query Parameters
| Parameter | Type | Description | Validation Rules |
|---|---|---|---|
search_text | string | Search in customer email, full name, product name, gifted email, or order number | Optional |
list | boolean | If true, returns a simple list of all gifts | Optional |
per_page | integer | Number of items per page | Optional, default: 10 |
filter[status] | string | Filter by gift status | Optional |
filter[type] | string | Filter by gift type | Optional |
filter[is_gifted_to_unknown] | boolean | Filter gifts given to unknown recipients | Optional |
filter[converted] | boolean | Filter converted gifts | Optional |
filter[gift_to_unregistered_customers] | boolean | Filter gifts to unregistered customers | Optional |
Response
{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"current_page": 1,
"first_page_url": "http://192.168.0.139:8080/v1/admin/gifts?page=1",
"from": 1,
"last_page": 289,
"last_page_url": "http://192.168.0.139:8080/v1/admin/gifts?page=289",
"links": [
{
"url": null,
"label": "« السابق",
"active": false
},
{
"url": "http://192.168.0.139:8080/v1/admin/gifts?page=1",
"label": "1",
"active": true
},
{
"url": "http://192.168.0.139:8080/v1/admin/gifts?page=2",
"label": "2",
"active": false
},
{
"url": "http://192.168.0.139:8080/v1/admin/gifts?page=3",
"label": "3",
"active": false
},
{
"url": null,
"label": "...",
"active": false
},
{
"url": "http://192.168.0.139:8080/v1/admin/gifts?page=288",
"label": "288",
"active": false
},
{
"url": "http://192.168.0.139:8080/v1/admin/gifts?page=289",
"label": "289",
"active": false
},
{
"url": "http://192.168.0.139:8080/v1/admin/gifts?page=2",
"label": "التالي »",
"active": false
}
],
"next_page_url": "http://192.168.0.139:8080/v1/admin/gifts?page=2",
"path": "http://192.168.0.139:8080/v1/admin/gifts",
"per_page": 10,
"prev_page_url": null,
"to": 10,
"total": 2890,
"gifts": [
{
"id": "7240a460-d217-11ef-985b-a7f75f09ed74",
"number": 2501202506,
"product_name": "الغضب",
"from_customer": "سُمية",
"to_customer": "فطوم",
"status": "completed",
"type": "new",
"gifted_to_email": "yaser.666f@gmail.com",
"gifted_from_email": "smsm1999smsm@icloud.com",
"is_gifted_to_unknown": false,
"gift_to_unregistered_customer": false,
"can_transfer_to_gar": false,
"gift_hand": "محدد",
"subscription_id": "b0a75e90-d217-11ef-8a03-d59df3aeb558",
"subscription_ids": null,
"order_id": "a2c63940-d217-11ef-9826-23f2e1e9d520",
"converted": true,
"created_at": "14/01/2025"
},
{
"id": "d1fdeef0-d215-11ef-9a90-33dfb2f0e2ae",
"number": null,
"product_name": "الغضب",
"from_customer": "سُمية",
"to_customer": "فطوم",
"status": "in cart",
"type": "new",
"gifted_to_email": "yaser.666f@gmail.com",
"gifted_from_email": "smsm1999smsm@icloud.com",
"is_gifted_to_unknown": false,
"gift_to_unregistered_customer": false,
"can_transfer_to_gar": false,
"gift_hand": "محدد",
"subscription_id": null,
"subscription_ids": null,
"order_id": null,
"converted": false,
"created_at": "14/01/2025"
},
{
"id": "42543ea0-d1e9-11ef-84e2-572de727c216",
"number": null,
"product_name": "حالة الطوارئ",
"from_customer": "Afra",
"to_customer": "--",
"status": "in cart",
"type": "new",
"gifted_to_email": "abalmazrooeeii@gmail.com",
"gifted_from_email": "abalmazrooeeiii@gmail.com",
"is_gifted_to_unknown": false,
"gift_to_unregistered_customer": true,
"can_transfer_to_gar": false,
"gift_hand": "محدد",
"subscription_id": null,
"subscription_ids": null,
"order_id": null,
"converted": false,
"created_at": "13/01/2025"
},
{
"id": "e0ad5070-d12e-11ef-8453-ff8eb4414cd5",
"number": null,
"product_name": "الخوف",
"from_customer": "تهاني العتيبي",
"to_customer": "ملوك دخيل الله العتيبي",
"status": "in cart",
"type": "new",
"gifted_to_email": "mda12226@gmail.com",
"gifted_from_email": "murshaditahani@gmail.com",
"is_gifted_to_unknown": false,
"gift_to_unregistered_customer": false,
"can_transfer_to_gar": false,
"gift_hand": "محدد",
"subscription_id": null,
"subscription_ids": null,
"order_id": null,
"converted": false,
"created_at": "13/01/2025"
}
]
},
"status_code": 200
}
Get Gift Details
GET /v1/admin/gifts/{id}
Returns details of a specific gift.
Response
{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"id": "7240a460-d217-11ef-985b-a7f75f09ed74",
"product_name": "الغضب",
"type": "new",
"status": "completed",
"number": 2501202506,
"gifted_to_email": "yaser.666f@gmail.com",
"is_gifted_to_unknown": false,
"is_messaged": true,
"sender": "سميه",
"recipient": "فطوم",
"message": "🫡❤️❤️❤️🦾",
"quantity": null,
"customer_id": "c1c9de50-cdcb-11ef-984e-f350fc830528",
"subscription_id": "b0a75e90-d217-11ef-8a03-d59df3aeb558",
"order_id": "a2c63940-d217-11ef-9826-23f2e1e9d520",
"converted": true,
"giftable_id": "d1269ae0-b67a-11ec-bbf2-5b94ce67d931",
"giftable_type": "App\\Models\\Course",
"meta": null
},
"status_code": 200
}
Update Gift Index
PATCH /v1/admin/gifts
Updates multiple gifts by their IDs.
Request Body
| Parameter | Type | Description | Validation Rules |
|---|---|---|---|
ids | array | Array of gift IDs to update | Required |
ids.* | string | Gift UUID | Required, UUID format |
Response
{
"success": true,
"message": "تم تحديث البيانات بنجاح.",
"status_code": 200
}
List Active GARs With Checking Subscription
GET /v1/admin/gifts/{id}/list-gars
Returns a list of active Group Application Requests (GARs) with subscription check for a specific gift.
Query Parameters
| Parameter | Type | Description | Validation Rules |
|---|---|---|---|
search_text | string | Search in email or full name | Optional |
Response
{
"data": [
{
"id": "cd9c5350-8418-11ee-852e-7d8867e42741",
"name": "مجد المطيري",
"email": "majdzaid12g@gmail.com",
"type": "student",
"is_subscriber": true
},
{
"id": "b81d4a1c-3846-4b6b-9e5f-7c568c0e23cb",
"name": "Kowthar Kytou",
"email": "kowthar.kytou1990@gmail.com",
"type": "student",
"is_subscriber": true
},
{
"id": "efb029b1-8039-492d-b807-ee403101d1fc",
"name": "Sarah Ahmad",
"email": "saraaldohaim99@gmail.com",
"type": "student",
"is_subscriber": true
},
{
"id": "488c09f0-d23b-11ee-9c6e-f563842e2444",
"name": "سمر العطوي",
"email": "smra2591@gmail.com",
"type": "student",
"is_subscriber": true
},
{
"id": "c4fb6620-cc21-11ee-8710-595a25da75a3",
"name": "ASO HRB",
"email": "asrarfr2030@gmail.com",
"type": "student",
"is_subscriber": false
},
{
"id": "800f5259-e352-4f36-95d0-d4088b469269",
"name": "Tamem Alrayes",
"email": "tamem3hr5@gmail.com",
"type": "student",
"is_subscriber": true
},
{
"id": "c907bd7f-6dd1-4c16-a140-e23f4f144bf3",
"name": "Zain AlQtaibi",
"email": "zi.77ain@gmail.com",
"type": "student",
"is_subscriber": true
},
{
"id": "065ba514-a4f9-4b5c-ab92-574ace51416c",
"name": "Jury Abualnoor",
"email": "jury.2001@hotmail.com",
"type": "student",
"is_subscriber": true
},
{
"id": "43472b80-4ff1-11ee-9db0-e17ffc81e9d4",
"name": "وصصال شطري",
"email": "zinanassim22@gmail.com",
"type": "student",
"is_subscriber": true
}
]
}
Convert Gift To Unknown Customer
POST /v1/admin/gifts/convert-gift-to-unknown
Converts a gift that was given to an unknown recipient to a specific customer.
Request Body
| Parameter | Type | Description | Validation Rules |
|---|---|---|---|
id | string | Gift ID | Required, UUID format |
recipient_customer_id | string | Recipient customer ID | Required, UUID format |
Response
{
"success": true,
"message": "تم الإهداء بنجاح",
"data": null,
"status_code": 200
}
Get Gifts Pages Count
GET /v1/admin/gifts-pages-count
Returns the count of gifts in different categories.
Response
{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"gifted_to_unregistered": 224,
"gifted_to_unknown": 79
},
"status_code": 200
}
Notes
- The list endpoint supports pagination and advanced filtering
- Results are sorted by creation date in descending order by default
- Gift conversion is only possible for gifts marked as
is_gifted_to_unknown = true - The system automatically sends an email notification to the recipient after successful gift conversion
- Gifts to unregistered customers are tracked after one month of creation
- The recipient customer must have a valid Group Application Request (GAR) to receive a converted gift