Skip to main content

Affiliated Items

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

List Affiliated Items

GET /v1/admin/customers/{id}/affiliated-items

Returns a list of affiliated items for a specific affiliate marketer.

Query Parameters

ParameterTypeDescriptionValidation Rules
search_textstringSearch in item nameOptional

Response

{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"affiliated_link": "/?ref=reem-6884",
"affiliated_items": [
{
"id": "8a620ad0-a5a2-11ee-8c63-07e9c26c60de",
"poster": "http://192.168.0.139:8000/storage/20786/مصادر-الثراء.png",
"type": "course",
"name": "مصادر الثراء",
"price": 333,
"uses": 1,
"link": "/materials/8a620ad0-a5a2-11ee-8c63-07e9c26c60de?ref=reem-6884"
},
{
"id": "eed201c0-b67a-11ec-b65b-7d2fd5d62143",
"poster": "http://192.168.0.139:8000/storage/28918/5--قانون-الجذب.jpg",
"type": "course",
"name": "قانون الجذب",
"price": 60,
"uses": 0,
"link": "/materials/eed201c0-b67a-11ec-b65b-7d2fd5d62143?ref=reem-6884"
},
{
"id": "ef9b1d00-b67a-11ec-b5e0-ffb2af260487",
"poster": "http://192.168.0.139:8000/storage/28915/طاقة-الفوضى.jpg",
"type": "course",
"name": "طاقة الفوضى",
"price": 60,
"uses": 0,
"link": "/materials/ef9b1d00-b67a-11ec-b5e0-ffb2af260487?ref=reem-6884"
},
{
"id": "135ebb10-c76b-11ef-94c7-610b2c08a5d6",
"poster": "http://192.168.0.139:8000/storage/28545/ابتلع-اموالك.jpg",
"type": "course",
"name": "ابتلع أموالك",
"price": 869.6,
"uses": 1,
"link": "/materials/135ebb10-c76b-11ef-94c7-610b2c08a5d6?ref=reem-6884"
},
{
"id": "d1269ae0-b67a-11ec-bbf2-5b94ce67d931",
"poster": "http://192.168.0.139:8000/storage/28911/3--الغضب.jpg",
"type": "course",
"name": "الغضب",
"price": 165.22,
"uses": 1,
"link": "/materials/d1269ae0-b67a-11ec-bbf2-5b94ce67d931?ref=reem-6884"
},
{
"id": "77f1a0c0-c7ad-11ef-be18-ef75837c4bf6",
"poster": "http://192.168.0.139:8000/storage/28564/تمرين-الاحتمال-الافضل.jpg",
"type": "course",
"name": "تمرين Reframing الاحتمال الأفضل",
"price": 173.91,
"uses": 1,
"link": "/materials/77f1a0c0-c7ad-11ef-be18-ef75837c4bf6?ref=reem-6884"
},
]
},
"status_code": 200
}

Create Affiliated Item

POST /v1/admin/affiliated-items

Creates a new affiliated item for a specific affiliate marketer.

Request Body

ParameterTypeDescriptionValidation Rules
customer_idstringID of the affiliate marketerRequired
product_typestringType of the product (course, bundle, ebook)Required
product_idintegerID of the productRequired

Response

{
"success": true,
"message": "تم حفظ البيانات بنجاح.",
"data": {
"id": "1b87c2a0-0586-11f0-93ca-bbd78edf57a9",
"poster": "http://192.168.0.139:8080/storage/24887/العظمة.png",
"type": "course",
"name": "العظمة",
"price": 390.44,
"uses": 0,
"link": "/materials/ad674230-282d-11ed-a628-9bcda960572f?ref=reem-6884"
},
"status_code": 200
}

Notes

  • The list endpoint supports search functionality
  • Results are sorted by creation date in descending order by default
  • Only users with the 'affiliate_marketer' role can create affiliated items
  • Each affiliate marketer can only have one affiliated item per product
  • The system supports three types of products: courses, bundles, and ebooks
  • The affiliated link is automatically generated using the marketer's username