Filtering - Venddor API

Filtering API Data

You can add URL parameters to your API requests to filter and refine the results returned by the API. This allows you to retrieve only the specific data you need.

Base URL Format: https://www.venddor.com.br/api/resource?filter1=value1&filter2=value2

Basic Filtering

You can specify filters by adding URL parameters that match object field names and their desired values.

GET /products?free_shipping=N

This example retrieves all products with non-free shipping.

curl --user admin@example.com:APIkey -X GET 'https://www.venddor.com.br/api/products?free_shipping=N'

Combining Multiple Filters

You can combine multiple conditions by adding several URL parameters, separated by the & character.

GET /products?is_edp=Y&company_id=1

This example retrieves all downloadable products (is_edp=Y) associated with company ID 1.

curl --user admin@example.com:APIkey -X GET 'https://www.venddor.com.br/api/products?is_edp=Y&company_id=1'

Response Format

The API response will contain:

{
  "products": {
    "15": {
      "product_id": "15",
      "product": "Product Name",
      "company_id": "1",
      "is_edp": "Y",
      "price": "29.99"
      // Other product fields...
    },
    "22": {
      // Another matching product...
    }
  },
  "search": {
    "is_edp": "Y",
    "company_id": "1"
  }
}
Tip: The matching objects are returned with their IDs as keys and their field arrays as values. This makes it easy to access a specific object by its ID.
Note: Refer to the API objects documentation pages for a complete list of supported fields that can be used for filtering.