Skip to content

Get Products List

Overview

GET /api/v2/products/

This endpoint returns a list of Products which are active.

Request

Query Parameters

Query

Key: q

Values: string

Example: ?q=Coffee

If given, limits the results to only those which soft match the given query string. This will be fuzzy matched against the product's name and description.

Minimum Price

Key: min_price

Values: integer A price, in pence

Example: ?min_price=100 (£1)

If given, limits the results to only products whose sale price is the given value, or higher.

Maximum Price

Key: max_price

Values: integer A price, in pence

Example: ?max_price=1000 (£10)

If given, limits the results to only products whose sale price is the given value, or lower.

Brand ID

Key: brand_id

Values: id This field can be given multiple times

Example: ?brand_id[]=1&brand_id[]=2

If given, limits the result to only products who belong to any of the given brands, specified by ID.

ID

Key: id

Values: id This field can be given multiple times

Example: ?id[]=1&id[]=2

If given, limits the result to only products whose ID match one of those given.

Embedded Entities

The endpoint supports embedding related entities - for a detailed overview of how this works, please read the API Overview.

Relation Entity Description
brand Brand The brand a Product belongs to

Examples

Get all products

/api/v2/products

{
    "data": [
        {"name": "Coffee", "sale_price": 200, ...},
        {"name": "Tea", "sale_price": 300, ...},
        {"name": "Afternoon Tea", "sale_price": 1000, ...}
    ]
}

Get Products matching "Tea"

/api/v2/products?q=Tea

{
    "data": [
        {"name": "Tea", "sale_price": 300, ...},
        {"name": "Afternoon Tea", "sale_price": 1000, ...}
    ]
}

Get Products over £6

/api/v2/products?min_price=600

{
    "data": [
        {"name": "Afternoon Tea", "sale_price": 1000, ...}
    ]
}