Pagination - Product Option Combinations

Overview

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.

Base URL: https://www.venddor.com.br/api

Pagination Parameters

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.
Tip: Pagination is particularly important for products with many option combinations (like size, color, material, etc.), as the total number of combinations can grow exponentially with each additional option.

Example

GET /api/combinations/?product_id=12&items_per_page=2&page=3

This request will return an array with 2 option combinations of the product with product_id=12 from the 3rd page.

Response Format

Let's examine a sample request to understand the response format:

GET /api/combinations/?product_id=12&items_per_page=2

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"
        }
    }
  }
]
Note: In this example, the combination values (3:"12", 4:"17" in the first item and 3:"13", 4:"17" in the second) represent specific option values. The keys (3 and 4) are option IDs, and the values ("12", "13", "17") are option value IDs.