When retrieving product option combinations through the Venddor API, you can control how many results are returned and which page of results to display using pagination parameters.
https://www.venddor.com.br/api
Add these parameters to your API requests to control the pagination of product option combinations:
| Parameter | Values | Description |
|---|---|---|
items_per_page |
integer | This parameter separates the list of option combinations into pages. It also limits the number of option combinations that you receive in the response. |
page |
integer | This parameter works only if you specify items_per_page. It determines the number of the page that will be sent in the response. |
This request will return an array with 2 option combinations of the product with product_id=12 from the 3rd page.
Let's examine a sample request to understand the response format:
This request retrieves two option combinations for a specific product (with ID 12).
If the request is successful, you'll receive HTTP/1.1 200 OK with the following JSON response:
[
{
"product_id": "12",
"product_code": "",
"combination_hash": "822274303",
"combination": {
"3": "12",
"4": "17"
},
"amount": "50",
"temp": "N",
"position": "0",
"image_pairs": {
"pair_id": "808",
"image_id": "0",
"detailed_id": "864",
"position": "0",
"detailed": {
"object_id": "822274303",
"object_type": "product_option",
"image_path": "http://localhost/images/detailed/0/173283_01.jpg",
"alt": "",
"image_x": "500",
"image_y": "500",
"http_image_path": "http://localhost/images/detailed/0/173283_01.jpg",
"https_image_path": "https://localhost/images/detailed/0/173283_01.jpg",
"absolute_path": "/var/www/html/images/detailed/0/173283_01.jpg",
"relative_path": "detailed/0/173283_01.jpg"
}
}
},
{
"product_id": "12",
"product_code": "",
"combination_hash": "2310967194",
"combination": {
"3": "13",
"4": "17"
},
"amount": "50",
"temp": "N",
"position": "1",
"image_pairs": {
"pair_id": "809",
"image_id": "0",
"detailed_id": "865",
"position": "0",
"detailed": {
"object_id": "2310967194",
"object_type": "product_option",
"image_path": "http://localhost/images/detailed/0/173283_0113298248354f43844356dc9.jpg",
"alt": "",
"image_x": "500",
"image_y": "500",
"http_image_path": "http://localhost/images/detailed/0/173283_0113298248354f43844356dc9.jpg",
"https_image_path": "https://localhost/images/detailed/0/173283_0113298248354f43844356dc9.jpg",
"absolute_path": "/var/www/html/images/detailed/0/173283_0113298248354f43844356dc9.jpg",
"relative_path": "detailed/0/173283_0113298248354f43844356dc9.jpg"
}
}
}
]