Skip to main content

Cart

These endpoints allow you to retrieve the current cart items and related information for both authenticated users and visitors.

Authenticated User Cart Index

POST /v1/mobile/cart

Response

{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"bundle_count": 0,
"course_count": 1,
"cart_items": [
{
"id": "8a620ad0-a5a2-11ee-8c63-07e9c26c60de",
"poster": "http://127.0.0.1:8000/storage/20786/مصادر-الثراء.png",
"name": "مصادر الثراء",
"course_name": null,
"price": 333,
"price_after_tax": 382.95,
"type": "course",
"count": 8,
"has_active_subscribed": false,
"added_by_special_id": false,
"duration": 730,
"old_price": null,
"has_certificate": false,
"certificate_price": 0,
"has_summary": false,
"summary_price": 0,
"in_bundle": true,
"bundle_id": "0cd19d50-c7af-11ef-8625-19aeda79ef02",
"bundle_name": "باقة الاستقلال المادي",
"meta": null,
"gift": null
}
],
"discounts": [],
"related_products": []
},
"status_code": 200
}

Implementation Details

Flow

  1. Validates the incoming request parameters
  2. For authenticated users:
    • Creates cart collection from products array
    • Generates related products
    • Retrieves available discounts
  3. Generates product collection with basic pricing
  4. Returns formatted response with cart items and additional data

Special Cases

  • Videos from the same course are grouped together
  • Product types are differentiated in the response
  • Gift-related information is included when applicable

Notes

  • This endpoint focuses on retrieving cart data without payment processing
  • Authenticated users get additional features like discounts and related products