Variant

Fetching list of master variants.

LIST

Returns a collection of master variant.

Filtering

You can filter your results as follows:

Fetch master variant list for specific id(s)
  • /variants?filter[id]=1
  • /variants?filter[id]=1,2,3
Fetch master variant list for specific production product id(s)
  • /variants?filter[production_product_id]=1
  • /variants?filter[production_product_id]=1,2,3
Fetch master variant list for min date
  • /variants?filter[discontinue_at_min]=2026-01-01 13:00:00
Fetch master variant list for max date
  • /variants?filter[discontinue_at_max]=2026-01-31 13:00:00
Fetch master variant list for exact date(s)
  • /variants?filter[discontinue_at]=2026-01-15 13:00:00
  • /variants?filter[discontinue_at]=2026-01-15 13:00:00,2026-02-20 14:50:00

Example of fetching master variant list

Request

GET /variants HTTP/1.1

Response

{
	"data": [
		{
			"id": 216,
			"product_id": 6,
			"sku": "production-variant-216",
			"external_identifier": "product-6-white-L",
			"hs_tariff_code": "9783660520736",
			"price": 125.51,
			"cost_price": 135.03,
			"tax_rate": 7,
			"is_master": false,
			"option_values": [
				{
					"id": 15,
					"handle": "L",
					"name": {
						"de": "L",
						"en": "L"
					},
					"option_type": 1,
					"media": [],
					"media_state": "empty",
					"created_at": "2023-01-10T10:11:20+00:00",
					"updated_at": "2023-01-10T10:11:20+00:00"
				},
				{
					"id": 5,
					"handle": "white",
					"name": {
						"de": "white",
						"en": "white"
					},
					"option_type": 2,
					"media": [
						159
					],
					"media_state": "empty",
					"created_at": "2023-01-10T10:11:18+00:00",
					"updated_at": "2023-01-10T10:11:18+00:00"
				}
			],
			"views": [
				{
					"handle": "front",
					"name": {
						"de": "Ansicht vorne",
						"en": "Front View",
						"nl": "Weergave van voren",
						"fr": "Vue de devant",
						"ar": "العرض بالأمام",
						"sv": "Framifrån",
						"pl": "Widok z przodu",
						"tr": "Ön görünüm",
						"es": "Vista delantera",
						"ko": "앞에 보기",
						"ja": "正面図",
						"it": "Vista anteriore"
					},
					"media": [
						{
							"id": 1028,
							"collection_name": "view-image",
							"file_name": "view-image-front-white.png",
							"size": 22296,
							"mime_type": "image/png",
							"download_url": "https://api.smake.io/temporary-url?expires=1674411027&path=files%2Fd5c6197f22b346a4882f973fc48e667e%2Fview-image-front-white.png&signature=662693284524afc132cdf5eed1033f6678a20cae056d1dca13629d151c456d01",
							"state": "pending",
							"requested": null,
							"failure_message": null,
							"created_at": "2023-01-10T10:11:28+00:00",
							"updated_at": "2023-01-10T10:11:28+00:00"
						}
					]
				},
				{
					"handle": "back",
					"name": {
						"de": "Ansicht hinten",
						"en": "Rear View",
						"nl": "Weergave van achteren",
						"fr": "Vue de derrière",
						"ar": "العرض بالخلف",
						"sv": "Bakifrån",
						"pl": "Widok z tyłu",
						"tr": "Arka görünüm",
						"es": "Vista trasera",
						"ko": "뒤 보기",
						"ja": "背面図",
						"it": "Vista posteriore"
					},
					"media": [
						{
							"id": 1029,
							"collection_name": "view-image",
							"file_name": "view-image-back-white.png",
							"size": 14983,
							"mime_type": "image/png",
							"download_url": "https://api.smake.io/temporary-url?expires=1674411027&path=files%2F58ad41b86e6148d291c06d70a31c4fd5%2Fview-image-back-white.png&signature=d0576289475239c9a1a2b5c0c551e353f3f56e751a8d0ea3af843fbe93cedbbb",
							"state": "pending",
							"requested": null,
							"failure_message": null,
							"created_at": "2023-01-10T10:11:28+00:00",
							"updated_at": "2023-01-10T10:11:28+00:00"
						}
					]
				},
				{
					"handle": "left",
					"name": {
						"de": "Ansicht links",
						"en": "Left View",
						"nl": "Weergave links",
						"fr": "Vue de gauche",
						"ar": "العرض يسارًا",
						"sv": "Från vänster",
						"pl": "Widok z lewej strony",
						"tr": "Sol görünüm",
						"es": "Vista izquierda",
						"ko": "좌측 보기",
						"ja": "左側面図",
						"it": "Vista a sinistra"
					},
					"media": [
						{
							"id": 1030,
							"collection_name": "view-image",
							"file_name": "view-image-left-white.png",
							"size": 10954,
							"mime_type": "image/png",
							"download_url": "https://api.smake.io/temporary-url?expires=1674411027&path=files%2F55112c57b5d246d4a040b3a1d5eb23b0%2Fview-image-left-white.png&signature=d08a1fcbbab3043de637a52a8d745ad8b1cc316ba372c94ad8e2b0be0f5def19",
							"state": "pending",
							"requested": null,
							"failure_message": null,
							"created_at": "2023-01-10T10:11:28+00:00",
							"updated_at": "2023-01-10T10:11:28+00:00"
						}
					]
				},
				{
					"handle": "right",
					"name": {
						"de": "Ansicht rechts",
						"en": "Right View",
						"nl": "Weergave rechts",
						"fr": "Vue de droite",
						"ar": "العرض يمينًا",
						"sv": "Från höger",
						"pl": "Widok z prawej strony",
						"tr": "Sağ görünüm",
						"es": "Vista derecha",
						"ko": "우측 보기",
						"ja": "右側面図",
						"it": "Vista a destra"
					},
					"media": [
						{
							"id": 1031,
							"collection_name": "view-image",
							"file_name": "view-image-right-white.png",
							"size": 11708,
							"mime_type": "image/png",
							"download_url": "https://api.smake.io/temporary-url?expires=1674411027&path=files%2F3490bd0183d44ab5ace39ceea4e534fc%2Fview-image-right-white.png&signature=9b49a81840f1e9b1dacce43afbbb6142ad2241948c2da592df07365ab833a8a0",
							"state": "pending",
							"requested": null,
							"failure_message": null,
							"created_at": "2023-01-10T10:11:28+00:00",
							"updated_at": "2023-01-10T10:11:28+00:00"
						}
					]
				}
			],
			"discontinue_at": null,
			"created_at": "2023-01-10T10:11:28+00:00",
			"updated_at": "2023-01-17T10:59:02+00:00"
		},
        ......
	],
	"links": {
		"first": null,
		"last": null,
		"prev": null,
		"next": "https://api.smake.io/master-administration/variants?cursor=eyJwcm9kdWN0aW9uX3ZhcmlhbnRzLmlkIjoyMDIsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0"
	},
	"meta": {
		"path": "https://api.smake.io/master-administration/variants",
		"per_page": 15,
		"next_cursor": "eyJwcm9kdWN0aW9uX3ZhcmlhbnRzLmlkIjoyMDIsIl9wb2ludHNUb05leHRJdGVtcyI6dHJ1ZX0",
		"prev_cursor": null
	}
}

GET

Returns a master variant of given id = x.

Example of fetching specified master variant information

Request

GET /variants/216 HTTP/1.1

Response

{
	"id": 216,
	"product_id": 6,
	"sku": "production-variant-216",
	"external_identifier": "product-6-white-L",
	"hs_tariff_code": "9783660520736",
	"price": 125.51,
	"cost_price": 135.03,
	"tax_rate": 7,
	"is_master": false,
	"option_values": [
		{
			"id": 15,
			"handle": "L",
			"name": {
				"de": "L",
				"en": "L"
			},
			"option_type": 1,
			"media": [],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:20+00:00",
			"updated_at": "2023-01-10T10:11:20+00:00"
		},
		{
			"id": 5,
			"handle": "white",
			"name": {
				"de": "white",
				"en": "white"
			},
			"option_type": 2,
			"media": [
				159
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:18+00:00",
			"updated_at": "2023-01-10T10:11:18+00:00"
		}
	],
	"views": [
		{
			"handle": "front",
			"name": {
				"de": "Ansicht vorne",
				"en": "Front View",
				"nl": "Weergave van voren",
				"fr": "Vue de devant",
				"ar": "العرض بالأمام",
				"sv": "Framifrån",
				"pl": "Widok z przodu",
				"tr": "Ön görünüm",
				"es": "Vista delantera",
				"ko": "앞에 보기",
				"ja": "正面図",
				"it": "Vista anteriore"
			},
			"media": [
				{
					"id": 1028,
					"collection_name": "view-image",
					"file_name": "view-image-front-white.png",
					"size": 22296,
					"mime_type": "image/png",
					"download_url": "https://api.smake.io/temporary-url?expires=1674411135&path=files%2Fd5c6197f22b346a4882f973fc48e667e%2Fview-image-front-white.png&signature=641ca9a22042abf06a1bdd5f17fb074cc0d63bafd0de5098f7298fb35d435cbe",
					"state": "pending",
					"requested": null,
					"failure_message": null,
					"created_at": "2023-01-10T10:11:28+00:00",
					"updated_at": "2023-01-10T10:11:28+00:00"
				}
			]
		},
		{
			"handle": "back",
			"name": {
				"de": "Ansicht hinten",
				"en": "Rear View",
				"nl": "Weergave van achteren",
				"fr": "Vue de derrière",
				"ar": "العرض بالخلف",
				"sv": "Bakifrån",
				"pl": "Widok z tyłu",
				"tr": "Arka görünüm",
				"es": "Vista trasera",
				"ko": "뒤 보기",
				"ja": "背面図",
				"it": "Vista posteriore"
			},
			"media": [
				{
					"id": 1029,
					"collection_name": "view-image",
					"file_name": "view-image-back-white.png",
					"size": 14983,
					"mime_type": "image/png",
					"download_url": "https://api.smake.io/temporary-url?expires=1674411135&path=files%2F58ad41b86e6148d291c06d70a31c4fd5%2Fview-image-back-white.png&signature=7abfcadf9d2c34e9b968f784edc5142bdbeac806bf4763b9a17b3f2fe51cb576",
					"state": "pending",
					"requested": null,
					"failure_message": null,
					"created_at": "2023-01-10T10:11:28+00:00",
					"updated_at": "2023-01-10T10:11:28+00:00"
				}
			]
		},
		{
			"handle": "left",
			"name": {
				"de": "Ansicht links",
				"en": "Left View",
				"nl": "Weergave links",
				"fr": "Vue de gauche",
				"ar": "العرض يسارًا",
				"sv": "Från vänster",
				"pl": "Widok z lewej strony",
				"tr": "Sol görünüm",
				"es": "Vista izquierda",
				"ko": "좌측 보기",
				"ja": "左側面図",
				"it": "Vista a sinistra"
			},
			"media": [
				{
					"id": 1030,
					"collection_name": "view-image",
					"file_name": "view-image-left-white.png",
					"size": 10954,
					"mime_type": "image/png",
					"download_url": "https://api.smake.io/temporary-url?expires=1674411135&path=files%2F55112c57b5d246d4a040b3a1d5eb23b0%2Fview-image-left-white.png&signature=957ae6eb2615ba8bab29bd337c1a30d9ec36a3f75447a7c3813da429c837d784",
					"state": "pending",
					"requested": null,
					"failure_message": null,
					"created_at": "2023-01-10T10:11:28+00:00",
					"updated_at": "2023-01-10T10:11:28+00:00"
				}
			]
		},
		{
			"handle": "right",
			"name": {
				"de": "Ansicht rechts",
				"en": "Right View",
				"nl": "Weergave rechts",
				"fr": "Vue de droite",
				"ar": "العرض يمينًا",
				"sv": "Från höger",
				"pl": "Widok z prawej strony",
				"tr": "Sağ görünüm",
				"es": "Vista derecha",
				"ko": "우측 보기",
				"ja": "右側面図",
				"it": "Vista a destra"
			},
			"media": [
				{
					"id": 1031,
					"collection_name": "view-image",
					"file_name": "view-image-right-white.png",
					"size": 11708,
					"mime_type": "image/png",
					"download_url": "https://api.smake.io/temporary-url?expires=1674411135&path=files%2F3490bd0183d44ab5ace39ceea4e534fc%2Fview-image-right-white.png&signature=7eb0caa5ee5d4fead124ad46c611cc73ceb7fd3e22d245da630f301a09886c6b",
					"state": "pending",
					"requested": null,
					"failure_message": null,
					"created_at": "2023-01-10T10:11:28+00:00",
					"updated_at": "2023-01-10T10:11:28+00:00"
				}
			]
		}
	],
	"discontinue_at": null,
	"created_at": "2023-01-10T10:11:28+00:00",
	"updated_at": "2023-01-17T10:59:02+00:00"
}

DELETE

Example of deleting a specified master variant for a specified master product

Request

DELETE /products/2/variant/1 HTTP/1.1

Response

HTTP/1.1 204 No Content

Validation Errors

404 Not Found – Production Product Not Found

{
  "message": "No results found for Production Product"
}

Possible causes:

  • The value in the URL ({productionProductId}) does not point to a valid Production Product or is invalid.

404 Not Found – Production Variant Not Found

{
  "message": "No results found for Production Variant"
}

Possible causes:

  • The value in the URL ({productionVariantId}) does not point to a valid Production Variant or is invalid.

423 Locked – Production Variant is being processed

{
  "message": "The product variant: 1 is being processed"
}

Possible causes:

  • To prevent the same product variant from being processed multiple times simultaneously, we lock the process until it is completed

500 Internal Server Error – Unexpected Error

{
  "message": "An unknown error occurred."
}

Possible causes:

  • Internal server error
  • Faulty system dependency
  • Database or service outage

Note: The error is automatically recorded and reported on the server side.