Products

The Products endpoint lets you list all products available.

{info} 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.code]=58975

See: Pagination, Filtering

Example

{primary.fa-paper-plane} Request

GET /products HTTP/1.1

{success} Response

HTTP/1.1 200 OK
{
    "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

{primary.fa-paper-plane} Request

GET /products/1 HTTP/1.1

{success} Response

HTTP/1.1 200 OK
{
    "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,
    ]
}