Skip to main content

Affiliated Sales

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

List Affiliated Sales

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

Returns a paginated list of affiliated sales for a specific affiliate marketer.

Query Parameters

ParameterTypeDescriptionValidation Rules
search_textstringSearch in item nameOptional
per_pageintegerNumber of items per pageOptional, defaults to 10

Response

{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"current_page": 1,
"first_page_url": "http://192.168.0.139:8080/v1/admin/customers/915438f8-dd7a-41de-9c94-d7539c3098dd/affiliated-sales?page=1",
"from": 1,
"last_page": 7,
"last_page_url": "http://192.168.0.139:8080/v1/admin/customers/915438f8-dd7a-41de-9c94-d7539c3098dd/affiliated-sales?page=7",
"links": [
{
"url": null,
"label": "« السابق",
"active": false
},
{
"url": "http://192.168.0.139:8080/v1/admin/customers/915438f8-dd7a-41de-9c94-d7539c3098dd/affiliated-sales?page=1",
"label": "1",
"active": true
},
{
"url": "http://192.168.0.139:8080/v1/admin/customers/915438f8-dd7a-41de-9c94-d7539c3098dd/affiliated-sales?page=2",
"label": "2",
"active": false
},
{
"url": "http://192.168.0.139:8080/v1/admin/customers/915438f8-dd7a-41de-9c94-d7539c3098dd/affiliated-sales?page=2",
"label": "التالي »",
"active": false
}
],
"next_page_url": "http://192.168.0.139:8080/v1/admin/customers/915438f8-dd7a-41de-9c94-d7539c3098dd/affiliated-sales?page=2",
"path": "http://192.168.0.139:8080/v1/admin/customers/915438f8-dd7a-41de-9c94-d7539c3098dd/affiliated-sales",
"per_page": 10,
"prev_page_url": null,
"to": 10,
"total": 70,
"affiliated_sales": [
{
"order_number": 2501201177,
"product_name": "اختبارات الثراء",
"price": "432.00",
"affiliate_percentage": "%20",
"affiliate_amount": "86.40",
"created_at": "2025-01-08"
},
{
"order_number": 2501201177,
"product_name": "أسئلة الثراء",
"price": "220.00",
"affiliate_percentage": "%20",
"affiliate_amount": "44.00",
"created_at": "2025-01-08"
},
{
"order_number": 2501200779,
"product_name": "الغيرة",
"price": "333.10",
"affiliate_percentage": "%20",
"affiliate_amount": "66.62",
"created_at": "2025-01-07"
},
{
"order_number": 2501200482,
"product_name": "باقة الاحتمال الأفضل",
"price": "387.38",
"affiliate_percentage": "%20",
"affiliate_amount": "77.48",
"created_at": "2025-01-06"
},
{
"order_number": 2501199808,
"product_name": "تمرين Reframing الاحتمال الأفضل",
"price": "173.91",
"affiliate_percentage": "%20",
"affiliate_amount": "34.78",
"created_at": "2025-01-04"
},
{
"order_number": 2501199808,
"product_name": "ابتلع أموالك",
"price": "869.60",
"affiliate_percentage": "%20",
"affiliate_amount": "173.92",
"created_at": "2025-01-04"
},
{
"order_number": 2501199808,
"product_name": "تمرين Reframing جذب المال",
"price": "260.87",
"affiliate_percentage": "%20",
"affiliate_amount": "52.17",
"created_at": "2025-01-04"
},
]
},
"status_code": 200
}

Export Affiliated Sales

GET /v1/admin/customers/{id}/export-affiliated-sales

Exports affiliated sales data for a specific affiliate marketer to a downloadable Excel file.

Response

Downloads an Excel file containing the affiliate marketer's sales data with the filename format: MarkterAffiliateSalesExport- {full_name} .xlsx

Notes

  • The list endpoint supports pagination and search functionality
  • Only completed sales are included in the list
  • Results are sorted by update date in descending order by default
  • The export functionality is only available for users with the 'affiliate_marketer' role
  • The export provides a convenient way to download sales data for offline analysis