Request
- GET /products
Query
page
(optional): Page number for products. Defaults to 1.perPage
(optional): Number of products per page. Defaults to 4.sortBy
(optional): Sort by date of updating the product. Defaults to Newest. Possible variants is:Newest
,Oldest
Example:
GET /products?page=2&perPage=10&sortBy=Newest
Response
The /products
endpoint returns a list of products in JSON format. Example response:
{
"totalProducts": 71,
"data": [
{
"id": "string",
"priceDiscount": 1000,
"name": "string"
// ...
}
// Other products...
]
}
Request
- GET /products/:id
Params
:id
: Product id
Example:
GET /products/productId
Response
The /products/:id
endpoint returns a list of products in JSON format. Example response:
{
"id": "string",
"priceDiscount": 1000,
"name": "string"
// ...
}