List
DevelopingGET
/productsValidation
Field | Type | Rule | Description |
---|---|---|---|
page |
integer |
nullable min:1 |
Read more on the Pagination page |
per_page |
integer |
nullable min:1 |
Read more on the Pagination page |
search |
string |
nullable |
|
sort |
string |
nullable |
Read more on the Sorting page |
includes |
array |
nullable |
Read more on the Includables page |
filter.market_id |
string |
nullable |
Id from Market model |
filter.branch_id |
string |
nullable |
Id from Branch model |
filter.product_category_id |
integer |
nullable |
Id from ProductCategory model |
filter.is_active |
boolean |
nullable |
|
filter.products_ids |
array |
nullable |
Array of id from Product model |
The rules on the fields will change depending on conditions, including the following
Field | Rule | Condition |
---|---|---|
filter.market_id |
required |
User authentication role SUBSCRIBER |
filter.branch_id |
required |
User authentication role SUBSCRIBER & has branch_id |
Request
Query Params
page
integer
optional
Example:
1
per_page
integer
optional
Example:
20
search
string
optional
sort
string
optional
includes[]
array[string]
optional
Example:
["modifiers"]
filter[market_id]
string
optional
Example:
b5d70a92-5d2e-4f89-8e52-1827cfbd01f4
filter[branch_id]
string
optional
filter[product_category_id]
integer
optional
filter[is_active]
integer
optional
filter[products_ids]
array[string]
optional
Request samples
Responses
OK(200)
HTTP Code: 200
Content Type : JSONapplication/json
Data Schema
meta
object
required
code
integer
required
status
string
required
message
string
required
data
object
required
current_page
integer
required
data
array [object {21}]
required
first_page_url
string
required
from
integer
required
last_page
integer
required
last_page_url
string
required
links
array [object {3}]
required
next_page_url
null
required
path
string
required
per_page
integer
required
prev_page_url
null
required
to
integer
required
total
integer
required
Example
{
"meta": {
"code": 200,
"status": "success",
"message": "Data Loaded Successfully"
},
"data": {
"current_page": 1,
"data": [
{
"id": "cfcdf305-4cfe-495c-9a33-c8dfc7a6b8c5",
"market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
"branch_id": "02510007-93b6-4121-93d7-c1bd79d00d0c",
"product_category_id": 3,
"name_en": "Twister Lunch Edited",
"name_ar": "Twister Lunch",
"description_en": "Tempore recusandae vel atque voluptatibus ea et nihil. Veniam eveniet laudantium cupiditate ratione non. Asperiores rem maiores neque inventore possimus itaque eum rerum. Delectus accusantium sit facilis. Ea voluptatibus natus quas eius commodi enim enim.",
"description_ar": "Tempore recusandae vel atque voluptatibus ea et nihil. Veniam eveniet laudantium cupiditate ratione non. Asperiores rem maiores neque inventore possimus itaque eum rerum. Delectus accusantium sit facilis. Ea voluptatibus natus quas eius commodi enim enim.",
"preparation_time": 20,
"stock": 819,
"order": 1,
"images": [
"https://cdn-flavours.fra1.digitaloceanspaces.com/img/uploads/products/1680366096-0.jpg"
],
"is_active": true,
"created_at": 1680271006458,
"updated_at": 1684246940577,
"deleted_at": null,
"rating_amount": 0,
"rating_avg": "0.00",
"sold_amount": 31,
"sold_revenue": 39.09,
"qoyod_id": null
},
{
"id": "8447de4e-740e-4181-a377-6dfa3f4d3aa2",
"market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
"branch_id": "02510007-93b6-4121-93d7-c1bd79d00d0c",
"product_category_id": 2,
"name_en": "Burger Deluxe",
"name_ar": "برجر ديلوكس",
"description_en": "Tempore recusandae vel atque voluptatibus ea et nihil. Veniam eveniet laudantium cupiditate ratione non. Asperiores rem maiores neque inventore possimus itaque eum rerum. Delectus accusantium sit facilis. Ea voluptatibus natus quas eius commodi enim enim.",
"description_ar": "Tempore recusandae vel atque voluptatibus ea et nihil. Veniam eveniet laudantium cupiditate ratione non. Asperiores rem maiores neque inventore possimus itaque eum rerum. Delectus accusantium sit facilis. Ea voluptatibus natus quas eius commodi enim enim.",
"preparation_time": 15,
"stock": 765,
"order": 2,
"images": [
"https://cdn-flavours.fra1.digitaloceanspaces.com/img/uploads/products/1680365973-0.jpg"
],
"is_active": true,
"created_at": 1680271006454,
"updated_at": 1684589809294,
"deleted_at": null,
"rating_amount": 0,
"rating_avg": "0.00",
"sold_amount": 64,
"sold_revenue": 64.5,
"qoyod_id": null
},
{
"id": "b194069b-a9fb-4261-bcdb-b8fc09ca1de8",
"market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
"branch_id": "02510007-93b6-4121-93d7-c1bd79d00d0c",
"product_category_id": 1,
"name_en": "Fried Chicken Zinger",
"name_ar": "Fried Chicken Zinger",
"description_en": "Tempore recusandae vel atque voluptatibus ea et nihil. Veniam eveniet laudantium cupiditate ratione non. Asperiores rem maiores neque inventore possimus itaque eum rerum. Delectus accusantium sit facilis. Ea voluptatibus natus quas eius commodi enim enim.",
"description_ar": "Tempore recusandae vel atque voluptatibus ea et nihil. Veniam eveniet laudantium cupiditate ratione non. Asperiores rem maiores neque inventore possimus itaque eum rerum. Delectus accusantium sit facilis. Ea voluptatibus natus quas eius commodi enim enim.",
"preparation_time": 30,
"stock": 827,
"order": 3,
"images": [
"https://cdn-flavours.fra1.cdn.digitaloceanspaces.com/img/uploads/products/1685032504-0.jpg",
"https://cdn-flavours.fra1.cdn.digitaloceanspaces.com/img/uploads/products/1685032520-0.jpg"
],
"is_active": true,
"created_at": 1680271006451,
"updated_at": 1684894474571,
"deleted_at": null,
"rating_amount": 0,
"rating_avg": "0.00",
"sold_amount": 68,
"sold_revenue": 70,
"qoyod_id": null
},
{
"id": "6f6a98b3-a3c8-4071-914f-04ca8fc8fcf2",
"market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
"branch_id": "02510007-93b6-4121-93d7-c1bd79d00d0c",
"product_category_id": 5,
"name_en": "Bakso",
"name_ar": "كرات اللحم",
"description_en": null,
"description_ar": null,
"preparation_time": 20,
"stock": null,
"order": 4,
"images": [
"https://cdn-flavours.fra1.cdn.digitaloceanspaces.com/img/uploads/products/1685619367-0.jpg"
],
"is_active": true,
"created_at": 1685619367346,
"updated_at": 1685619367346,
"deleted_at": null,
"rating_amount": 0,
"rating_avg": "0.00",
"sold_amount": 0,
"sold_revenue": 0,
"qoyod_id": null
},
{
"id": "d576ee28-6e9b-4fdf-b815-d3664fcf3bd0",
"market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
"branch_id": null,
"product_category_id": 1,
"name_en": "Ice Bucket",
"name_ar": "Ice Bucket",
"description_en": null,
"description_ar": null,
"preparation_time": null,
"stock": null,
"order": 5,
"images": null,
"is_active": true,
"created_at": 1697718465568,
"updated_at": 1697718465568,
"deleted_at": null,
"rating_amount": 0,
"rating_avg": "0.00",
"sold_amount": 0,
"sold_revenue": 0,
"qoyod_id": null
},
{
"id": "ba2e0bd4-f506-4461-93ac-e9860e74970b",
"market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
"branch_id": null,
"product_category_id": 2,
"name_en": "Test",
"name_ar": "Test",
"description_en": null,
"description_ar": null,
"preparation_time": null,
"stock": null,
"order": 6,
"images": null,
"is_active": true,
"created_at": 1697791202558,
"updated_at": 1697791202558,
"deleted_at": null,
"rating_amount": 0,
"rating_avg": "0.00",
"sold_amount": 2,
"sold_revenue": 15.2,
"qoyod_id": null
},
{
"id": "0e27c6db-1af8-4921-ba1c-604609e92d5c",
"market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
"branch_id": null,
"product_category_id": 1,
"name_en": "Satay",
"name_ar": "Satay",
"description_en": null,
"description_ar": null,
"preparation_time": null,
"stock": null,
"order": 7,
"images": null,
"is_active": true,
"created_at": 1697877482385,
"updated_at": 1697877482385,
"deleted_at": null,
"rating_amount": 0,
"rating_avg": "0.00",
"sold_amount": 0,
"sold_revenue": 0,
"qoyod_id": null
},
{
"id": "846c78c8-80db-4464-95eb-d65e3129ed15",
"market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
"branch_id": null,
"product_category_id": 1,
"name_en": "Melon Mojito",
"name_ar": "Melon Mojito",
"description_en": null,
"description_ar": null,
"preparation_time": null,
"stock": null,
"order": 8,
"images": null,
"is_active": true,
"created_at": 1697881695326,
"updated_at": 1697881695326,
"deleted_at": null,
"rating_amount": 0,
"rating_avg": "0.00",
"sold_amount": 4,
"sold_revenue": 0,
"qoyod_id": null
},
{
"id": "715d8428-79b9-4add-bfbd-dce99e105958",
"market_id": "5d4196d7-355a-48ef-9c50-add58cc440f1",
"branch_id": null,
"product_category_id": 1,
"name_en": "Domba",
"name_ar": "Domba",
"description_en": null,
"description_ar": null,
"preparation_time": null,
"stock": null,
"order": 9,
"images": null,
"is_active": true,
"created_at": 1697881737395,
"updated_at": 1697881737395,
"deleted_at": null,
"rating_amount": 0,
"rating_avg": "0.00",
"sold_amount": 1,
"sold_revenue": 0,
"qoyod_id": null
}
],
"first_page_url": "http://localhost:8000/api/v2/products?page=1&per_page=20&filter%5Bmarket_id%5D=5d4196d7-355a-48ef-9c50-add58cc440f1",
"from": 1,
"last_page": 1,
"last_page_url": "http://localhost:8000/api/v2/products?page=1&per_page=20&filter%5Bmarket_id%5D=5d4196d7-355a-48ef-9c50-add58cc440f1",
"links": [
{
"url": null,
"label": "« Previous",
"active": false
},
{
"url": "http://localhost:8000/api/v2/products?page=1&per_page=20&filter%5Bmarket_id%5D=5d4196d7-355a-48ef-9c50-add58cc440f1",
"label": "1",
"active": true
},
{
"url": null,
"label": "Next »",
"active": false
}
],
"next_page_url": null,
"path": "http://localhost:8000/api/v2/products",
"per_page": 20,
"prev_page_url": null,
"to": 9,
"total": 9
}
}
Last modified: a month ago