Retrieve Products
GET /api/v1/Products
Description
This endpoint allows retrieving a list of products with pagination.
Headers:
- No specific headers are required.
Path Parameters:
version: The version of the API.
Query Parameters:
-
pageNumber: The number of the page to retrieve. Default is 1. -
pageSize: The number of products to retrieve per page. Default is 10.
URL:
- GET:
/api/v1/Products
Response:
- 200: Success, returns a list of products with pagination details.
Error Codes:
-
400: Bad request, the request is not valid.
-
404: Not found, the product does not exist or is invalid.
-
500: Internal server error, something went wrong while processing the request.
Example Response:
HTTP/1.1 200 OK
{
"products": [
{
"id": "123",
"name": "Product1",
"description": "Description of Product1",
"price": 100.00,
"categoryId": "abc123",
"imageUrl": "https://example.com/product1.jpg",
"availability": true,
"createdAt": "2024-02-16T12:00:00Z",
"updatedAt": "2024-02-17T12:00:00Z"
},
{
"id": "124",
"name": "Product2",
"description": "Description of Product2",
"price": 200.00,
"categoryId": "abc124",
"imageUrl": "https://example.com/product2.jpg",
"availability": true,
"createdAt": "2024-02-16T13:00:00Z",
"updatedAt": "2024-02-17T13:00:00Z"
}
],
"pagination": {
"pageNumber": 1,
"pageSize": 10,
"totalPages": 2,
"totalItems": 20
}
}
Notes:
-
The response includes an array of products and pagination details.
-
The pagination object contains information about the current page, the total number of pages, and the total number of products.
-
This endpoint can be useful for listing products with pagination support.
Method: GET
/api/v1/Products?pageNumber=1&pageSize=10
Headers
| Content-Type | Value |
|---|---|
| Accept | text/plain |
Query Params
| Param | value |
|---|---|
| pageNumber | 1 |
| pageSize | 10 |
Response: 200
{
"pageNumber": "<integer>",
"pageSize": "<integer>",
"total": "<integer>",
"succeeded": "<boolean>",
"message": "<string>",
"errors": [
"<string>",
"<string>"
],
"data": [
{
"id": "<uuid>",
"merchantId": "<uuid>",
"name": "<string>",
"number": "<string>",
"description": "<string>",
"salesPrice": "<double>",
"documents": [
{
"id": "<uuid>",
"externalId": "<uuid>",
"url": "<string>",
"name": "<string>"
},
{
"id": "<uuid>",
"externalId": "<uuid>",
"url": "<string>",
"name": "<string>"
}
]
},
{
"id": "<uuid>",
"merchantId": "<uuid>",
"name": "<string>",
"number": "<string>",
"description": "<string>",
"salesPrice": "<double>",
"documents": [
{
"id": "<uuid>",
"externalId": "<uuid>",
"url": "<string>",
"name": "<string>"
},
{
"id": "<uuid>",
"externalId": "<uuid>",
"url": "<string>",
"name": "<string>"
}
]
}
]
}
LANGUAGE
CURL REQUEST
curl --request GET \
--url /api/v1/Products \
--header 'accept: application/json' \
--header 'content-type: application/json'
RESPONSE
Click Try It! to start a request and see the response here!