SmakeSmake API Docs
EndpointsVariants

List variants

GET
/variants

Here you can view a product variant or design a new one from an existing product variant.

When designing, information such as customizations, dimensions, files, etc. must be transferred. After that you will receive a new product variant that can be ordered.

Returns a collection of variants.

Filtering

You can filter your results as follows — see Pagination, Filtering:

  • /variants?filter[id]=1 / /variants?filter[id]=1,2,3 — list variants for specified id(s)
  • /variants?filter[origin.sku]=42443 — list variants for a specified sku (not an exact search)
  • /variants?filter[origin.external_identifier]=extern-123 — list variants for external identifier
  • /variants?filter[collection_name]=catalogue — list variants for specified collection name(s)

Expanding relationships

You can expand some resources to show more details — see Expanding Objects:

  • /variants?expand=product — show the content of the product instead of the id
  • /variants?expand=views.customizations.resource — show the content of the customizations' resource
AuthorizationbearerAuth

Authorization

bearerAuth
AuthorizationBearer <token>

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?integer

Page number to return — see Basic Usage → Pagination.

Default1
per_page?integer

Number of objects per page (default 25, maximum 100) — see Basic Usage → Pagination.

Rangevalue <= 100
Default25
filter[id]?string

List variants for specified id(s). Multiple ids are separated by comma: /variants?filter[id]=1 or /variants?filter[id]=1,2,3.

filter[origin.sku]?string

List variants for a specified sku. The filtering is not an exact search, it looks for a part in the attribute value: /variants?filter[origin.sku]=42443.

filter[origin.external_identifier]?string

List variants for external identifier. You can filter your external identifier: /variants?filter[origin.external_identifier]=extern-123.

filter[collection_name]?string

List variants for specified collection name(s): /variants?filter[collection_name]=catalogue.

Allowed values are:

Collection nameDescription
catalogueAll variants which are created in the app administration. This can be used for designing.
customVariants which are designed by you but not ordered. See Design.
orderedAll ordered variants.

Value in

  • "catalogue"
  • "custom"
  • "ordered"
expand?string

You can expand some resources to show more details — see Expanding Objects. Allowed values:

  • product — You can show the content of the product instead of the id.
  • views.customizations.resource — You can show the content of the customizations' resource. The type is described by the resource_type attribute of the customization.

Header Parameters

Accept*"application/json"

The API only responds with JSON — this header is mandatory on every request (see Setup → Headers).

Default"application/json"

Value in

  • "application/json"

Response Body

application/json

application/json

Request example
curl -X GET "https://example.com/variants?filter%5Bid%5D=1%2C2%2C3&filter%5Borigin.sku%5D=42443&filter%5Borigin.external_identifier%5D=extern-123&filter%5Bcollection_name%5D=catalogue&expand=product" \  -H "Accept: application/json"

GET /variants HTTP/1.1

{  "data": [    {      "id": 6,      "state": "completed",      "collection_name": "catalogue",      "total": 97.37,      "price": 91,      "tax": 6.37,      "tax_rate": 7,      "option_values": [        {          "handle": "CadetBlue",          "name": "Cadet blue",          "option_type": {            "handle": "color",            "name": "color"          }        },        {          "handle": "m",          "name": "medium",          "option_type": {            "handle": "size",            "name": "size"          }        }      ],      "origin": {        "sku": "0441837446362",        "external_identifier": "56879425369"      },      "product": 8,      "views": [        {          "handle": "front",          "name": "Ansicht vorne",          "media": [            {              "id": 25,              "is_test": 0,              "collection_name": "view-image",              "file_name": "view-image-front-cadetblue.png",              "size": 54738,              "mime_type": "image/png",              "download_url": "https://smake-public.s3.eu-west-1.amazonaws.com/files/e1fd546508dd484b908c5fc653f65818/view-image-front-lime.png?xyz",              "state": "completed",              "failure_message": null,              "created_at": "2022-02-21T11:10:40+00:00",              "updated_at": "2022-02-21T11:10:40+00:00"            }          ],          "customizations": [            {              "id": 2,              "hash": "f6a925c77977ab958267ad897cf7af25706c02c6",              "production_method": 1,              "resource_type": "logo",              "resource": 5,              "price": 0,              "calculation_type": "square_centimeter",              "calculation_value": 119.52,              "x": 130,              "y": 50,              "width": 144,              "height": 83,              "position": "tc",              "rotation": 0,              "created_at": "2022-02-21T11:11:33+00:00",              "updated_at": "2022-02-21T11:11:33+00:00"            }          ]        }      ],      "created_at": "2018-02-21T10:49:41+00:00",      "updated_at": "2018-02-21T10:49:41+00:00"    },    {      "id": 6,      "state": "completed",      "collection_name": "catalogue",      "total": 97.37,      "price": 91,      "tax": 6.37,      "tax_rate": 7,      "option_values": [        {          "handle": "yellow",          "name": "yellow",          "option_type": {            "handle": "color",            "name": "color"          }        },        {          "handle": "xl",          "name": "extra large",          "option_type": {            "handle": "size",            "name": "size"          }        }      ],      "origin": {        "sku": "0441837446362",        "external_identifier": "56879425369"      },      "product": 8,      "views": [        {          "handle": "front",          "name": "Ansicht vorne",          "media": [            {              "id": 6,              "is_test": 0,              "collection_name": "view-image",              "file_name": "view-image-front-yellow.png",              "size": 54738,              "mime_type": "image/png",              "download_url": "https://smake-public.s3.eu-west-1.amazonaws.com/files/e1fd546508dd484b908c5fc653f65818/view-image-front-lime.png?xyz",              "state": "completed",              "failure_message": null,              "created_at": "2022-02-21T11:10:40+00:00",              "updated_at": "2022-02-21T11:10:40+00:00"            }          ],          "customizations": []        }      ],      "created_at": "2018-02-21T10:49:41+00:00",      "updated_at": "2018-02-21T10:49:41+00:00"    },    {      "id": 6,      "state": "completed",      "collection_name": "catalogue",      "total": 97.37,      "price": 91,      "tax": 6.37,      "tax_rate": 7,      "option_values": [        {          "handle": "red",          "name": "red",          "option_type": {            "handle": "color",            "name": "color"          }        },        {          "handle": "s",          "name": "small",          "option_type": {            "handle": "size",            "name": "size"          }        }      ],      "origin": {        "sku": "0441837446362",        "external_identifier": "56879425369"      },      "product": 8,      "views": [        {          "handle": "front",          "name": "Ansicht vorne",          "media": [            {              "id": 6,              "is_test": 0,              "collection_name": "view-image",              "file_name": "view-image-front-red.png",              "size": 54738,              "mime_type": "image/png",              "download_url": "https://smake-public.s3.eu-west-1.amazonaws.com/files/e1fd546508dd484b908c5fc653f65818/view-image-front-lime.png?xyz",              "state": "completed",              "failure_message": null,              "created_at": "2022-02-21T11:10:40+00:00",              "updated_at": "2022-02-21T11:10:40+00:00"            }          ],          "customizations": []        }      ],      "created_at": "2018-02-21T10:49:41+00:00",      "updated_at": "2018-02-21T10:49:41+00:00"    }  ],  "links": {    "first": "https://api.smake.io/v2/variants?page=1",    "last": null,    "prev": null,    "next": "https://api.smake.io/v2/variants?page=2"  },  "meta": {    "current_page": 1,    "from": 1,    "path": "https://api.smake.io/v2/variants",    "per_page": 15,    "to": 15  }}