List products
The Products endpoint lets you list all products available.
Info: Variants Attribute is expandable. See: Expanding Objects
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 - List products for a specified design method —
/products?filter[designable_production_methods]=direct-to-film
See: Pagination, Filtering
Expanding relationships
You can expand some resources to show more details.
See: Expanding Objects
- Expand variant — You can show the variant data instead of the
id:/products?expand=variants - Expand variants customizations resource — You can show entire variant data including customizations resources:
/products?expand=variants.views.customizations.resource - Expand product's allowed designable methods — You can show which methods design can be done on this product:
/products?expand=designable_production_methods
AuthorizationbearerAuth
Authorization
bearerAuth API token as bearer token — you receive a test and a live token, there is no switch between them. See Setup → Authentication and Setup → Test mode.
In: header
Query Parameters
Page number to return — see Basic Usage → Pagination.
1Number of objects per page (default 25, maximum 100) — see Basic Usage → Pagination.
value <= 10025List products for specified id(s). Several ids can be passed comma-separated:
/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
List products for a specified design method:
/products?filter[designable_production_methods]=direct-to-film
You can expand some resources to show more details — see Expanding Objects. Allowed values:
variants— Expand variant. You can show the variant data instead of theid.variants.views.customizations.resource— Expand variants customizations resource. You can show entire variant data including customizations resources.designable_production_methods— Expand product's allowed designable methods. You can show which methods design can be done on this product.
Header Parameters
The API only responds with JSON — this header is mandatory on every request (see Setup → Headers).
"application/json"Value in
- "application/json"
Response Body
application/json
application/json
curl -X GET "https://example.com/products?filter%5Bid%5D=1%2C2%2C3&filter%5Btitle%5D=qui&filter%5Bvariants.origin.sku%5D=58975&filter%5Borigin.manufacturer_number%5D=X01234&filter%5Bdesignable_production_methods%5D=direct-to-film&expand=variants" \ -H "Accept: application/json"GET /products HTTP/1.1
{ "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", "designable_production_methods": [ 1, 2, 3 ], "variants": [ 1, 2, 3 ] }, { "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", "designable_production_methods": [], "variants": [ 37, 38, 39 ] } ], "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 a text GET
Returns the text with the `id` = **x**.
Show product GET
Returns the product with the `id` = **x**. ### Expanding relationships You can expand some resources to show more details. See: [Expanding Objects](/docs/checkout/2022-02-01/basic/expanding-objects) - **Expand variant** — You can show the variant data instead of the `id`: `/products/1?expand=variants` - **Expand variants customizations resource** — You can show entire variant data including customizations resources: `/products/1?expand=variants.views.customizations.resource` - **Expand product's allowed designable methods** — You can show details of allowed designable production method: `/products/1?expand=designable_production_methods`