To get all active products with pagination, for a particular category.
https://access.way2order.com/api/v1/getproductsbycategory/{categoryID}
Content-Type: application/json
Authorization: Bearer {access_token}
The following query parameters are available
Parameter | Description | |
---|---|---|
sort | Sort Order | Refer 'Sort Fields' below |
page | Page Number | Default 1 |
per_page | Records per Page | Default 25, Maximum 100 |
The query parameters are to be appended to the endpoint. To get 20 products from page 2, for category A with an id of 12345, sorted by 'name' in descending (DESC) order, the endpoint with the query parameters will be
https://access.way2order.com/api/v1/getproductsbycategory/12345?sort=-name&page=2&per_page=20
The following sort fields are available
ASC Order | DESC Order | |
---|---|---|
dt_create | -dt_create | |
dt_update | -dt_update | |
code | -code | Default |
name | -name |
{
"data": [
{
"_id": "5b630118a8b17871571c43d1",
"code": "ARCS 200",
"name": "Bronze Globe Valve (Screwed)",
"isenabled": true,
"isvisible": true,
"dt_create": "2018-08-02T13:03:20.998Z",
"dt_update": "2018-12-15T12:51:50.141Z",
"id": "5b630118a8b17871571c43d1"
},
{
"_id": "5b630118a8b17871571c43d2",
"code": "ARCS 201",
"name": "Bronze Angle Globe Valve No.4 (Screwed)",
"isenabled": true,
"isvisible": true,
"dt_create": "2018-08-02T13:03:20.999Z",
"dt_update": "2018-12-14T08:36:11.713Z",
"id": "5b630118a8b17871571c43d2"
},
...
],
"pagination": {
"page": 1,
"per_page": 25,
"total_pages": 2,
"total_elements": 47
}
}
Attribute | Type | Description |
---|---|---|
_id | String | ID of the Product |
code | String | Product Code |
name | String | Product Name |
isenabled | Boolean | true if enabled, false if deleted |
isvisible | Boolean | true if visible, false if hidden |
dt_create | Date | Product Creation Date |
dt_update | Date | Product Last Updation Date |
id | String | ID of the Product |
From the 'data' Array, the '_id' for a particular product can then be used to fetch complete details about the product using the endpoint /getproductdetails/{productID}
The 'pagination' Object in the response contains the following information
Property | Details |
---|---|
page | Current Page Number |
per_page | Records per Page |
total_pages | Total Number of Pages |
total_elements | Total Records |