Skip to main content

Course Management

This section covers the API endpoints for managing courses in the admin panel.

List Courses

GET /v1/admin/courses

Retrieve a list of courses. Can be filtered and paginated.

Query Parameters

ParameterTypeDescription
listbooleanOptional. If true, returns a simplified list of all courses
search_textstringOptional. Search in course name, ID, product ID, descriptions, and category names
filter[category]stringOptional. Filter by category ID
filter[active]booleanOptional. Filter by active status
filter[is_purchasable]booleanOptional. Filter by purchasable status
filter[trashed]stringOptional. Include trashed courses
sortstringOptional. Sort by field (name, priority, active, subscriptions_count)
per_pageintegerOptional. Number of courses per page (default: 10)

Response

{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"current_page": 1,
"first_page_url": "http://testing-api.sumaya369.net/v1/admin/courses?per_page=3&page=1",
"from": 1,
"last_page": 60,
"last_page_url": "http://testing-api.sumaya369.net/v1/admin/courses?per_page=3&page=60",
"links": [
{
"url": null,
"label": "« السابق",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/admin/courses?per_page=3&page=1",
"label": "1",
"active": true
},
{
"url": "http://testing-api.sumaya369.net/v1/admin/courses?per_page=3&page=2",
"label": "2",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/admin/courses?per_page=3&page=3",
"label": "3",
"active": false
},
{
"url": null,
"label": "...",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/admin/courses?per_page=3&page=59",
"label": "59",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/admin/courses?per_page=3&page=60",
"label": "60",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/admin/courses?per_page=3&page=2",
"label": "التالي »",
"active": false
}
],
"next_page_url": "http://testing-api.sumaya369.net/v1/admin/courses?per_page=3&page=2",
"path": "http://testing-api.sumaya369.net/v1/admin/courses",
"per_page": 3,
"prev_page_url": null,
"to": 3,
"total": 179,
"courses": [
{
"id": "00b399c0-f43f-11ef-ab99-f766475f8fdb",
"short_id": "00b399c0",
"poster": "https://sumaya-lms-backend-testing.s3.us-east-2.amazonaws.com/front-end/images/plsXZh3njeoQMsTU7MyMmVqKrt6GYxdfKNEfHN0c.jpg",
"name": "bnvb",
"priority": "75-",
"is_purchasable": false,
"rating": 0,
"subscriptions_count": 0,
"videos_count": 1,
"comments_count": 0,
"views_count": 0,
"rates_count": 0,
"active": false,
"categories": []
},
{
"id": "aa638800-e3b7-11ef-9e2a-8d6bfe81df58",
"short_id": "aa638800",
"poster": "https://sumaya369-testing-media.s3.us-east-2.amazonaws.com/23497/%D8%B5%D9%88%D8%B1%D8%A92.png",
"name": "نسخة من (اعداء النجاح) dhdhdh",
"priority": "100-",
"is_purchasable": true,
"rating": 0,
"subscriptions_count": 0,
"videos_count": 1,
"comments_count": 0,
"views_count": 0,
"rates_count": 0,
"active": false,
"categories": []
},
{
"id": "272bc8b0-dedf-11ef-8311-5f9852bea80c",
"short_id": "272bc8b0",
"poster": "https://sumaya369-testing-media.s3.us-east-2.amazonaws.com/23489/50fd7810--%D8%A7%D9%84%D8%B6%D8%AD%D9%83-%D9%85%D9%88%D9%82%D8%B9.png",
"name": "نسخة من (وعي الضحك)",
"priority": "100-115842",
"is_purchasable": false,
"rating": 0,
"subscriptions_count": 0,
"videos_count": 0,
"comments_count": 0,
"views_count": 0,
"rates_count": 0,
"active": false,
"categories": []
}
]
},
"status_code": 200
}

Get Course Statistics

GET /v1/admin/statistics/courses

Retrieve statistics about courses including counts, most subscribed, and most profitable courses.

Response

{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"courses_count": "191/146",
"most_subscribed_courses": [
{
"id": "eed201c0-b67a-11ec-b65b-7d2fd5d62143",
"poster": "http://192.168.0.139:8080/storage/28918/5--قانون-الجذب.jpg",
"name": "قانون الجذب",
"subscriptions": "31.8K"
},
{
"id": "ee097290-b67a-11ec-93f3-278a553f3188",
"poster": "http://192.168.0.139:8080/storage/28917/7--قانون-التوسع.jpg",
"name": "قانون التوسع",
"subscriptions": "24K"
}
],
"most_profitable_courses": [
{
"id": "e9df76d0-b67a-11ec-9d65-290bbf70d635",
"name": "دايزي- الوعي الزواجي",
"profit": "2.2M"
},
{
"id": "fe38f640-b67a-11ec-be96-813016b81c8f",
"name": "آفا - الوعي الطفولي",
"profit": "1.4M"
},
{
"id": "fee57500-b67a-11ec-86b8-effe1ae70080",
"name": "ابنوس",
"profit": "1.2M"
},
{
"id": "f4e2e370-b67a-11ec-a86b-bb46bd23c3af",
"name": "مسرح الاحلام",
"profit": "1.1M"
}
]
},
"status_code": 200
}

Create Course

POST /v1/admin/courses

Create a new course.

Request Body

ParameterTypeDescription
namestringRequired. Course name (min: 3 characters)
product_descriptionstringOptional. Course product description
course_descriptionstringOptional. Course detailed description
posterfileOptional. Course poster image (max: 1MB)
pricenumberRequired. Course price (min: 0)
hide_pricebooleanOptional. Whether to hide the course price
can_commentbooleanOptional. Whether comments are allowed
is_purchasablebooleanOptional. Whether the course can be purchased
has_certificatebooleanOptional. Whether the course offers a certificate
has_promotionalbooleanOptional. Whether the course has promotional content
has_summarybooleanOptional. Whether the course has a summary
has_reduced_pricebooleanOptional. Whether the course has a reduced price
viewable_if_customer_has_orderbooleanOptional. Whether the course is viewable for customers with orders
activebooleanOptional. Course status
durationintegerOptional. Course duration in minutes
lengthstringOptional. Course length
certificate_pricenumberOptional. Price for the certificate (min: 0)
has_quantitybooleanOptional. Whether the course has quantity limit
has_special_idbooleanOptional. Whether the course has a special ID
quantitynumberRequired if has_quantity is true. Course quantity (min: 0)
summary_pricenumberOptional. Price for the summary (min: 0)
summaryfileRequired if has_summary is true. Course summary file (max: 25MB, PDF/DOC/XLS)
resubscription_discountnumberRequired if can_resubscribe is true. Discount for resubscription (min: 0)
can_resubscribebooleanOptional. Whether resubscription is allowed
can_requestbooleanOptional. Whether course requests are allowed
is_open_sourcebooleanOptional. Whether the course is open source
tag_namesarrayOptional. Array of tag names
tag_names.*stringRequired with tag_names. Tag name (min: 1 character)
category_idsarrayOptional. Array of category UUIDs
category_ids.*stringRequired with category_ids. Valid category UUID
related_products_idsarrayOptional. Array of related course UUIDs
related_products_ids.*stringRequired with related_products_ids. Valid course UUID
before_products_idsarrayOptional. Array of prerequisite course UUIDs
before_products_ids.*stringRequired with before_products_ids. Valid course UUID
after_products_idsarrayOptional. Array of follow-up course UUIDs
after_products_ids.*stringRequired with after_products_ids. Valid course UUID
target_audience_descriptionstringOptional. Description of target audience
is_target_audience_activebooleanOptional. Whether target audience section is active
display_before_productsbooleanOptional. Whether to display prerequisite products
display_after_productsbooleanOptional. Whether to display follow-up products
videosarrayRequired. Array of course videos
videos.*.titlestringRequired. Video title
videos.*.video_idstringRequired. Video ID
videos.*.is_promotionalbooleanRequired. Whether video is promotional
videos.*.lengthstringOptional. Video length (format: HH:MM:SS)
pointsnumberOptional. Awarded points from subscribing to the Course (min: 0)
priorityintegerOptional. Course priority (min: 1)
cloud_pdf_urlarrayOptional. Array of cloud PDF URLs
cloud_pdf_url.*stringRequired with cloud_pdf_url. Valid CloudPDF.io URL
to_be_learnarrayOptional. Array of learning objectives
to_be_learn.*stringRequired with to_be_learn. Learning objective description

Response

{
"success": true,
"message": "تم حفظ البيانات بنجاح.",
"data": {
"id": "d4dd2400-0598-11f0-b4ef-4b1d482d8b81",
"poster": "https://sumaya-lms-backend-testing.s3.us-east-2.amazonaws.com/front-end/images/plsXZh3njeoQMsTU7MyMmVqKrt6GYxdfKNEfHN0c.jpg",
"name": "سول ديتوكس",
"course_description": "دورة سول ديتوكس",
"product_description": "دورة سول ديتوكس",
"duration": 350,
"length": "20",
"price": "99999.00",
"price_after_tax": 114998.85,
"certificate_price": 200,
"summary": "",
"summary_name": "",
"summary_price": 2,
"has_promotional": true,
"hide_price": true,
"is_open_source": false,
"is_purchasable": true,
"has_certificate": true,
"can_comment": true,
"special_id": null,
"has_special_id": false,
"quantity": 3,
"has_quantity": true,
"has_summary": false,
"can_resubscribe": false,
"can_request": false,
"resubscription_discount": "0.00",
"special_link": "",
"active": true,
"points": 0,
"comments_count": 0,
"views_count": 0,
"in_bundle": false,
"has_reduced_price": true,
"viewable_if_customer_has_order": false,
"target_audience_description": "dsfsdfsdfsdfsfd",
"is_target_audience_active": true,
"display_before_products": true,
"display_after_products": true,
"tag_names": [
"الصدمة",
"كلام"
],
"priority": 5,
"videos": [
{
"id": "d4e39ec0-0598-11f0-82e2-67281f62df38",
"number": 1,
"title": "الصدمة العظمى",
"description": "لماذا الأحمر أخضر",
"video_id": 578945123,
"length": "00:00:00",
"price": "0.00",
"is_promotional": true
}
],
"category_ids": [
"e4e0bb10-db44-11ec-91f3-dff7c0899e8e"
],
"tags": [
{
"id": "8e12aa80-058b-11f0-8565-0564f783faee",
"name": "الصدمة",
"color": "#98DEDE"
},
{
"id": "8e132dd0-058b-11f0-bc23-3fc55dbc7eaa",
"name": "كلام",
"color": "#98DEDE"
}
],
"related_products": [],
"before_products": [
{
"id": "50d699e0-9bb6-11ed-886c-8ba6664adc93",
"name": "قانون السعي",
"poster": "http://192.168.0.139:8080/storage/21263/7--قانون-السعي.png"
}
],
"after_products": [
{
"id": "569ba740-4700-11ee-9a7b-11b6864f4035",
"name": "نداء الاثير",
"poster": "http://192.168.0.139:8080/storage/24886/نداء-الأثير.png"
}
],
"material_type_ids": [],
"body_type_ids": [],
"awareness_level_ids": [],
"attachments": [],
"to_be_learn": null
},
"status_code": 200
}

Get Course Details

GET /v1/admin/courses/{id}

Retrieve details of a specific course.

Response

{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"id": "d32c6190-b67a-11ec-955e-b940e5a4bde1",
"poster": "http://192.168.0.139:8080/storage/28913/2--الثقة-بالنفس.jpg",
"name": "الثقة بالنفس - العار",
"course_description": "<p class=\"ql-align-right\"> </p>",
"product_description": "<ul><li>مادة مسجلة تساعدك على الوصول لحالة الثقة في ١٥ يوم </li><li>ما هو شعور الثقة&nbsp;بالنفس ؟</li><li>لماذا أنا غير واثق؟&nbsp;</li></ul><p><br></p><p>*هذه المادة مناسبة للمرضع.</p><p>*هذه المادة غير مناسبة للحامل.</p><p><br></p><p><br></p><hr><p><br></p><p>هذه المادة متوفرة في نافا .</p><p class=\"ql-align-right\"><strong style=\"color: black;\">بشراءك أي منتج تفيد أنك قد قرأت ووافقت على </strong><a href=\"https://sumaya369.net/privacy-policy\" rel=\"noopener noreferrer\" target=\"_blank\" style=\"display: inline !important;\"><strong style=\"display: inline !important;\">الشروط والأحكام</strong></a></p><p class=\"ql-align-right\"><strong>للمساعدة : </strong><a href=\"https://sumaya369.net/FAQ\" rel=\"noopener noreferrer\" target=\"_blank\" style=\"display: inline !important;\"><strong style=\"display: inline !important;\">تواصل معنا</strong></a></p><p><br></p>",
"duration": 730,
"length": "01:04:56",
"price": "95.65",
"price_after_tax": 109.9975,
"certificate_price": 0,
"summary": "",
"summary_name": "",
"summary_price": 0,
"has_promotional": true,
"hide_price": false,
"is_open_source": false,
"is_purchasable": true,
"has_certificate": false,
"can_comment": true,
"special_id": "PdEyTqFnTk",
"has_special_id": true,
"quantity": 0,
"has_quantity": false,
"has_summary": false,
"can_resubscribe": true,
"can_request": false,
"resubscription_discount": "50.00",
"special_link": "/materials/PdEyTqFnTk",
"active": true,
"points": 0,
"comments_count": 92,
"views_count": 0,
"in_bundle": true,
"has_reduced_price": false,
"viewable_if_customer_has_order": false,
"target_audience_description": "<p class=\"ql-align-right\"><br></p>",
"is_target_audience_active": null,
"display_before_products": null,
"display_after_products": null,
"tag_names": [
"تطبيقات بسيطة",
"للجسد المشاعري",
"مادة للتنظيف"
],
"priority": 4,
"videos": [
{
"id": "a8e936e0-bcfc-11ec-96cc-091be34065e1",
"number": 1,
"title": "وصف المادة",
"description": "",
"video_id": 672465324,
"length": "00:00:00",
"price": "0.00",
"is_promotional": true
},
{
"id": "a8ea92b0-bcfc-11ec-aab5-8de992ed4b7c",
"number": 2,
"title": "قصتي مع الثقة بالنفس",
"description": "",
"video_id": 472521402,
"length": "00:00:00",
"price": "0.00",
"is_promotional": false
},
{
"id": "a8ec07f0-bcfc-11ec-9b7d-6d993ee5df73",
"number": 3,
"title": "ما هو شعور الثقة بالنفس؟",
"description": "",
"video_id": 472522543,
"length": "00:00:00",
"price": "0.00",
"is_promotional": false
},
{
"id": "a8ed5c80-bcfc-11ec-8358-4193f7327ef1",
"number": 4,
"title": "لماذا أنا غير واثق؟",
"description": "",
"video_id": 472524363,
"length": "00:00:00",
"price": "0.00",
"is_promotional": false
},
],
"category_ids": [
"fe1802d7-576b-36b5-a768-9d5cdf185ba3"
],
"tags": [
{
"id": "c60fa260-fb24-11ee-af71-350be8551fdb",
"name": "تطبيقات بسيطة",
"color": "#E697E6FF"
},
{
"id": "965e3cc0-fb24-11ee-9658-b558db5ba9ce",
"name": "للجسد المشاعري",
"color": "#9CDBDBFF"
},
{
"id": "c18a0c70-fb45-11ee-9590-2927458bbee4",
"name": "مادة للتنظيف",
"color": "#F8F8F8FF"
}
],
"related_products": [
{
"id": "d27fad20-b67a-11ec-b2cf-074f45b6446a",
"name": "التأنيب"
}
],
"before_products": [],
"after_products": [],
"material_type_ids": [
"78c6f250-ecfb-11ef-b665-e797907d8d2d"
],
"body_type_ids": [
"7d567be0-e91e-11ef-9111-a7bb1ab24945"
],
"awareness_level_ids": [
"72aabaf0-e91a-11ef-bca7-a58031c131b1"
],
"attachments": [],
"to_be_learn": null
},
"status_code": 200
}

Update Multiple Courses

PATCH /v1/admin/courses

Update multiple courses at once.

Request Body

ParameterTypeDescription
idsarrayRequired. Array of course UUIDs
ids.*stringRequired. Course UUID
is_purchasablebooleanOptional. Update purchasable status
activebooleanOptional. Update active status
hide_pricebooleanOptional. Update price visibility
restorebooleanOptional. Restore deleted courses

Response

{
"success": true,
"message": "تم تحديث البيانات بنجاح.",
"data": null,
"status_code": 200
}

Update Course

PATCH /v1/admin/courses/{id}

Update a specific course.

Request Body

Same parameters as Create Course endpoint.

Response

{
"success": true,
"message": "تم تحديث البيانات بنجاح.",
"data": {
"id": "d4dd2400-0598-11f0-b4ef-4b1d482d8b81",
"poster": "https://sumaya-lms-backend-testing.s3.us-east-2.amazonaws.com/front-end/images/plsXZh3njeoQMsTU7MyMmVqKrt6GYxdfKNEfHN0c.jpg",
"name": "سول ديتوكس",
"course_description": "دورة سول ديتوكس",
"product_description": "دورة سول ديتوكس",
"duration": 350,
"length": "20",
"price": "99999.00",
"price_after_tax": 114998.85,
"certificate_price": 200,
"summary": "",
"summary_name": "",
"summary_price": 2,
"has_promotional": true,
"hide_price": true,
"is_open_source": false,
"is_purchasable": false,
"has_certificate": true,
"can_comment": true,
"special_id": null,
"has_special_id": false,
"quantity": 3,
"has_quantity": true,
"has_summary": false,
"can_resubscribe": false,
"can_request": false,
"resubscription_discount": "0.00",
"special_link": "",
"active": true,
"points": 7,
"comments_count": 0,
"views_count": 0,
"in_bundle": false,
"has_reduced_price": true,
"viewable_if_customer_has_order": false,
"target_audience_description": "dsfsdfsdfsdfsfd",
"is_target_audience_active": true,
"display_before_products": true,
"display_after_products": true,
"tag_names": [
"الصدمة",
"كلام"
],
"priority": 5,
"videos": [
{
"id": "d4e39ec0-0598-11f0-82e2-67281f62df38",
"number": 1,
"title": "الصدمة العظمى",
"description": "لماذا الأحمر أخضر",
"video_id": 578945123,
"length": "00:00:00",
"price": "0.00",
"is_promotional": true
}
],
"category_ids": [],
"tags": [
{
"id": "8e12aa80-058b-11f0-8565-0564f783faee",
"name": "الصدمة",
"color": "#98DEDE"
},
{
"id": "8e132dd0-058b-11f0-bc23-3fc55dbc7eaa",
"name": "كلام",
"color": "#98DEDE"
}
],
"related_products": [],
"before_products": [
{
"id": "50d699e0-9bb6-11ed-886c-8ba6664adc93",
"name": "قانون السعي",
"poster": "http://192.168.0.139:8080/storage/21263/7--قانون-السعي.png"
}
],
"after_products": [
{
"id": "569ba740-4700-11ee-9a7b-11b6864f4035",
"name": "نداء الاثير",
"poster": "http://192.168.0.139:8080/storage/24886/نداء-الأثير.png"
}
],
"material_type_ids": [],
"body_type_ids": [],
"awareness_level_ids": [],
"attachments": [],
"to_be_learn": "[\"\\u062a\\u0645\\u0627\\u0631\\u064a\\u0646 \\u062c\\u0630\\u0628 \\u0627\\u0644\\u0645\\u0627\\u0644\",\"\\u062a\\u0645\\u0627\\u0631\\u064a\\u0646 \\u062c\\u0630\\u0628 \\u0627\\u0644\\u0645\\u0627\\u0644\"]"
},
"status_code": 200
}

Delete Courses

DELETE /v1/admin/courses

Delete one or multiple courses.

Request Body

ParameterTypeDescription
idsarrayRequired. Array of course UUIDs to delete
ids.*stringRequired. Course UUID
confirm_deletionbooleanOptional. Force delete courses

Response

{
"success": true,
"message": "تم حذف البيانات بنجاح.",
"data": null,
"status_code": 200
}

Export Course Subscriptions

GET /v1/admin/exports/courses/subscriptions

Export course subscriptions data to Excel.

Query Parameters

ParameterTypeDescription
fromstringRequired. Start date
tostringRequired. End date

Response

Downloads an Excel file containing course subscriptions data.

Export Course Subscription Details

GET /v1/admin/exports/courses/{id}

Export detailed subscription data for a specific course.

Response

Downloads an Excel file containing detailed course subscription data.

Generate Special ID

POST /v1/admin/courses/generate-special-id/{id}

Generate a special ID for a course.

Response

{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"id": "d32c6190-b67a-11ec-955e-b940e5a4bde1",
"poster": "http://192.168.0.139:8080/storage/28913/2--الثقة-بالنفس.jpg",
"name": "الثقة بالنفس - العار",
"course_description": "<p class=\"ql-align-right\"> </p>",
"product_description": "<ul><li>مادة مسجلة تساعدك على الوصول لحالة الثقة في ١٥ يوم </li><li>ما هو شعور الثقة&nbsp;بالنفس ؟</li><li>لماذا أنا غير واثق؟&nbsp;</li></ul><p><br></p><p>*هذه المادة مناسبة للمرضع.</p><p>*هذه المادة غير مناسبة للحامل.</p><p><br></p><p><br></p><hr><p><br></p><p>هذه المادة متوفرة في نافا .</p><p class=\"ql-align-right\"><strong style=\"color: black;\">بشراءك أي منتج تفيد أنك قد قرأت ووافقت على </strong><a href=\"https://sumaya369.net/privacy-policy\" rel=\"noopener noreferrer\" target=\"_blank\" style=\"display: inline !important;\"><strong style=\"display: inline !important;\">الشروط والأحكام</strong></a></p><p class=\"ql-align-right\"><strong>للمساعدة : </strong><a href=\"https://sumaya369.net/FAQ\" rel=\"noopener noreferrer\" target=\"_blank\" style=\"display: inline !important;\"><strong style=\"display: inline !important;\">تواصل معنا</strong></a></p><p><br></p>",
"duration": 730,
"length": "01:04:56",
"price": "95.65",
"price_after_tax": 109.9975,
"certificate_price": 0,
"summary": "",
"summary_name": "",
"summary_price": 0,
"has_promotional": true,
"hide_price": false,
"is_open_source": false,
"is_purchasable": true,
"has_certificate": false,
"can_comment": true,
"special_id": "D6LW4YVL1Z",
"has_special_id": true,
"quantity": 0,
"has_quantity": false,
"has_summary": false,
"can_resubscribe": true,
"can_request": false,
"resubscription_discount": "50.00",
"special_link": "/materials/D6LW4YVL1Z",
"active": true,
"points": 0,
"comments_count": 92,
"views_count": 0,
"in_bundle": true,
"has_reduced_price": false,
"viewable_if_customer_has_order": false,
"target_audience_description": "<p class=\"ql-align-right\"><br></p>",
"is_target_audience_active": null,
"display_before_products": null,
"display_after_products": null,
"tag_names": [
"تطبيقات بسيطة",
"للجسد المشاعري",
"مادة للتنظيف"
],
"priority": 4,
"videos": [
{
"id": "a8e936e0-bcfc-11ec-96cc-091be34065e1",
"number": 1,
"title": "وصف المادة",
"description": "",
"video_id": 672465324,
"length": "00:00:00",
"price": "0.00",
"is_promotional": true
},
{
"id": "a8ea92b0-bcfc-11ec-aab5-8de992ed4b7c",
"number": 2,
"title": "قصتي مع الثقة بالنفس",
"description": "",
"video_id": 472521402,
"length": "00:00:00",
"price": "0.00",
"is_promotional": false
},
{
"id": "a8ec07f0-bcfc-11ec-9b7d-6d993ee5df73",
"number": 3,
"title": "ما هو شعور الثقة بالنفس؟",
"description": "",
"video_id": 472522543,
"length": "00:00:00",
"price": "0.00",
"is_promotional": false
},
],
"category_ids": [
"fe1802d7-576b-36b5-a768-9d5cdf185ba3"
],
"tags": [
{
"id": "c60fa260-fb24-11ee-af71-350be8551fdb",
"name": "تطبيقات بسيطة",
"color": "#E697E6FF"
},
{
"id": "965e3cc0-fb24-11ee-9658-b558db5ba9ce",
"name": "للجسد المشاعري",
"color": "#9CDBDBFF"
},
{
"id": "c18a0c70-fb45-11ee-9590-2927458bbee4",
"name": "مادة للتنظيف",
"color": "#F8F8F8FF"
}
],
"related_products": [
{
"id": "d27fad20-b67a-11ec-b2cf-074f45b6446a",
"name": "التأنيب"
}
],
"before_products": [],
"after_products": [],
"material_type_ids": [
"78c6f250-ecfb-11ef-b665-e797907d8d2d"
],
"body_type_ids": [
"7d567be0-e91e-11ef-9111-a7bb1ab24945"
],
"awareness_level_ids": [
"72aabaf0-e91a-11ef-bca7-a58031c131b1"
],
"attachments": [],
"to_be_learn": null
},
"status_code": 200
}

Duplicate Courses

POST /v1/admin/courses/duplicate

Create copies of existing courses.

Request Body

ParameterTypeDescription
idsarrayRequired. Array of course UUIDs to duplicate
ids.*stringRequired. Course UUID

Response

{
"success": true,
"message": "تم حفظ البيانات بنجاح.",
"data": null,
"status_code": 200
}

Authorization

All course management endpoints require admin authorization. The user must have the appropriate permissions to perform these operations.

Notes

Course Creation and Validation

  • Course names must be at least 3 characters long
  • Course prices must be non-negative numbers
  • Videos are required when creating or editing a course regardless of changes
  • Course media files (like posters) are automatically handled and stored in collections
  • Courses can have multiple attachments (max: 25MB each)
  • Cloud PDF files can be linked to courses via CloudPDF.io URLs
  • When updating videos, existing videos are preserved by their ID
  • New free videos are automatically added to existing subscriptions

Course Management

  • Course statistics track both total and active course counts
  • Most subscribed courses statistics show the top 2 courses by subscription count
  • Most profitable courses statistics show the top 4 courses by total order value
  • Only completed orders (credit card or bank accepted status) are counted in profitability calculations
  • Courses can be associated with categories, body types, awareness levels, and material types
  • Courses can have related products, before products (prerequisites), and after products (follow-ups)
  • Courses support three media collections: poster (single file), summary (single file), and attachments (multiple files)
  • Courses can have cloud PDF files linked via CloudPDF.io URLs
  • Videos can be marked as promotional and are ordered by their number field

Course Duplication

  • Duplicated courses are created as inactive and non-purchasable by default
  • Duplicated courses have their priority set to 100
  • Course name is prefixed with "نسخة من" (copy of)
  • All media files are automatically copied to the new course
  • Special IDs are not carried over to duplicated courses

Special Features

  • Special IDs are randomly generated 10-character strings
  • Course subscriptions can be exported to Excel format with date range filtering
  • Detailed subscription data for individual courses can be exported
  • Courses can have learning objectives (to_be_learn field)
  • Courses can be marked as open source, which makes them accessible without authentication
  • Courses can have target audience descriptions
  • Courses can be configured to allow resubscription with a discount
  • Courses can be configured to be viewable for customers with any order

Deletion Rules

  • Courses can be soft deleted (default) or force deleted
  • Courses with active subscriptions or bundles cannot be force deleted
  • Soft-deleted courses can be restored

Batch Operations

  • Multiple courses can be updated simultaneously for properties like purchasable status and active status
  • Multiple courses can be duplicated in a single operation
  • Batch deletion supports both soft and force delete operations

Video Management

  • Videos are automatically numbered sequentially when created or updated
  • Videos can be marked as promotional, which doesn't count towards course completion
  • Videos can have individual prices (default: 0)
  • New free videos are automatically added to existing active subscriptions
  • When updating a course, all videos must be included in the request, even unchanged ones

Update Process

  • When updating a course, relationships can be detached by not including them in the request
  • Attachments and cloud PDFs can be selectively deleted during updates
  • When updating videos, existing videos are identified by their ID
  • Changing a course to non-purchasable will delete all related cart items