Rider Product Exchanges API Documentation
This document provides the necessary details to interact with the Rider Product Exchanges API endpoints. The API allows users to retrieve information about product exchanges made by riders, including various filtering options.
Base URL
https://talabatkw.wearyourebrand.com/api/v2
Endpoints
GET /product-exchangesRetrieve information about product exchanges made by riders. This endpoint allows various filtering options to narrow down the results based on the provided parameters.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
rider_id | bigint | (optional) Filter by rider ID. |
3pl | text | (optional) Filter by third-party logistics (3PL) name. |
product_id | bigint | (optional) Filter by old product ID. |
variation_id | bigint | (optional) Filter by old product variation ID. |
new_product_id | bigint | (optional) Filter by new product ID. |
new_variation_id | bigint | (optional) Filter by new product variation ID. |
exchange_date_from | date | (optional) Filter by exchange date (start range). |
exchange_date_to | date | (optional) Filter by exchange date (end range). |
exchange_type | text | (optional) Filter by exchange type. |
replacement_type | text | (optional) Filter by replacement type (Lost, Accident,Exchange ). |
Response
The response will be a JSON array of product exchange details. Each object in the array contains the following fields:
| Field | Description |
|---|---|
Rider ID | (bigint) ID of the rider. |
3PL | (text) Name of the third-party logistics. |
Old Product ID | (bigint) ID of the old product. |
Old Product Name | (longtext) Name of the old product. |
Old Product Variation ID | (bigint) ID of the old product variation. |
Old Product Variation Name | (longtext) Name of the old product variation. |
New Product ID | (bigint) ID of the new product. |
New Product Name | (longtext) Name of the new product. |
New Product Variation ID | (bigint) ID of the new product variation. |
New Product Variation Name | (longtext) Name of the new product variation. |
Exchange Date | (datetime) Date when the product was exchanged. |
Exchange Type | (text) Type of the exchange. |
Replacement_type | (text) Type of the replacement |
App User ID | (bigint) ID of the user who processed the exchange. |
Example Request
GET /product-exchanges?rider_id=50&exchange_date_from=2024-01-01&exchange_date_to=2024-06-01Example Response
Example Response
[ { "Rider ID": 50, "3PL": "Logistics Company A", "Old Product ID": 123, "Old Product Name": "Helmet", "Old Product Variation ID": 1, "Old Product Variation Name": "Size L", "New Product ID": 124, "New Product Name": "Helmet 2.0", "New Product Variation ID": 2, "New Product Variation Name": "Size XL", "Exchange Date": "2024-01-15 10:30:00", "Exchange Type": "Warranty", "Replacement Type": "Lost", "App User ID": 10 }, { "Rider ID": 50, "3PL": "Logistics Company B", "Old Product ID": 456, "Old Product Name": "Jacket", "Old Product Variation ID": 2, "Old Product Variation Name": "Size M", "New Product ID": 457, "New Product Name": "Jacket 2.0", "New Product Variation ID": 3, "New Product Variation Name": "Size L", "Exchange Date": "2024-02-10 14:45:00", "Exchange Type": "Upgrade", "Replacement Type": "Exchange", "App User ID": 15 }]Notes
Ensure that the date format for exchange_date_from and exchange_date_to is YYYY-MM-DD. The parameter names are case-sensitive. If no parameters are provided, the endpoint returns all product exchange details.
Example
Scenario: Filtering by Rider ID and Date Range To retrieve products exchanged by rider with ID 50 between 2024-01-01 and 2024-06-01:
GET /product-exchanges?rider_id=50&exchange_date_from=2024-01-01&exchange_date_to=2024-06-01Response
[ { "Rider ID": 50, "3PL": "Logistics Company A", "Old Product ID": 123, "Old Product Name": "Helmet", "Old Product Variation ID": 1, "Old Product Variation Name": "Size L", "New Product ID": 124, "New Product Name": "Helmet 2.0", "New Product Variation ID": 2, "New Product Variation Name": "Size XL", "Exchange Date": "2024-01-15 10:30:00", "Exchange Type": "Warranty", "Replacement Type": "Accident", "App User ID": 10 }]