This is the documentation for 2021-02-23 but the latest version is 2022-02-01. You can switch versions in the menu.

Products

The Products endpoint lets you list all products available.

Variants Attribute is expandable. See: Expanding Objects

List

Returns a collection of products.

Filtering

You can filter your results as follows:

List products for specified id(s)

  • /products?filter[id]=1
  • /products?filter[id]=1,2,3

List products for specified title

  • /products?filter[title]=qui

List products for a specified origin code

  • /products?filter[variants.origin.sku]=58975

List products for a specified origin manufacturer_number

  • /products?filter[origin.manufacturer_number]=X01234

See: Pagination, Filtering

Example

Request

GET /products HTTP/1.1

Response

{
    "data": [
        {
            "is_test": false,
            "id": 1,
            "title": "qui ut nemo",
            "description": "Autem nesciunt ipsam excepturi non distinctio quas ullam placeat. Quam quidem rerum veniam corrupti velit aperiam non. Repudiandae rem incidunt atque optio vero et voluptatem. Fuga et quos in ipsa.",
            "created_at": "2017-11-15T08:07:48+00:00",
            "updated_at": "2017-11-15T08:07:48+00:00",
            "variants": [
                90,
                92,
                94,
            ]
        },
        {
            "is_test": false,
            "id": 30,
            "title": "ut",
            "description": "Et voluptatem quas neque praesentium qui harum. Ea occaecati perferendis inventore tempore nemo. Nobis perferendis voluptas sed tempore at.",
            "created_at": "2017-11-15T08:07:51+00:00",
            "updated_at": "2017-11-15T08:07:51+00:00",
            "variants": [
                96,
                98,
                100
                102,
                104
            ]
        }
        ...
    ],
    "links": {
        "first": "https://api.smake.io/v2/products?page=1",
        "last": null,
        "prev": null,
        "next": "https://api.smake.io/v2/products?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "path": "https://api.smake.io/v2/products",
        "per_page": 25,
        "to": 25
    }
}

Get

Returns the product with the id = x.

Example

Request

GET /products/1 HTTP/1.1

Response

{
    "is_test": false,
    "id": 1,
    "title": "qui ut nemo",
    "description": "Autem nesciunt ipsam excepturi non distinctio quas ullam placeat. Quam quidem rerum veniam corrupti velit aperiam non. Repudiandae rem incidunt atque optio vero et voluptatem. Fuga et quos in ipsa.",
    "created_at": "2017-11-15T08:07:48+00:00",
    "updated_at": "2017-11-15T08:07:48+00:00",
    "variants": [
        90,
        92,
        94,
    ]
}