Affiliated Sales
This guide explains how to interact with the Affiliated Sales API endpoints in the Sumaya369 web application. These endpoints allow affiliate marketers to track their sales and commissions.
List Affiliated Sales
Retrieve a list of completed sales made through affiliate marketing links along with their details and statistics.
Endpoint
- Method: GET
- URL:
/v1/customer/affiliated-sales
Request Headers
| Header | Value | Required |
|---|---|---|
| Content-Type | application/json | Yes |
| Accept | application/json | Yes |
| Authorization | Bearer token | Yes |
Query Parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
| search_text | string | Filter sales by item name | No |
| per_page | integer | Number of items per page (default: 10) | No |
Success Response
{
"success": true,
"message": "تم جلب البيانات بنجاح.",
"data": {
"current_page": 1,
"first_page_url": "http://testing-api.sumaya369.net/v1/customer/affiliated-sales?page=1",
"from": 1,
"last_page": 1,
"last_page_url": "http://testing-api.sumaya369.net/v1/customer/affiliated-sales?page=1",
"links": [
{
"url": null,
"label": "« السابق",
"active": false
},
{
"url": "http://testing-api.sumaya369.net/v1/customer/affiliated-sales?page=1",
"label": "1",
"active": true
},
{
"url": null,
"label": "التالي »",
"active": false
}
],
"next_page_url": null,
"path": "http://testing-api.sumaya369.net/v1/customer/affiliated-sales",
"per_page": 10,
"prev_page_url": null,
"to": 1,
"total": 1,
"affiliated_sales": [
{
"order_number": 2407156334,
"product_name": "الحياد",
"price": "290.44",
"affiliate_percentage": "%4",
"affiliate_amount": "11.62",
"created_at": "2024-07-23"
}
]
},
"status_code": 200
}
Implementation Flow
- Authenticate with valid customer token
- Call the endpoint to retrieve affiliated sales
- Use pagination parameters to navigate through sales history
- Filter results using the search parameter if needed
Key Considerations
- Authentication is required
- Only completed sales are included in the response
- Results are sorted by most recent updates first
- Response includes both item and order details
- Pagination is supported for handling large datasets