Product Option Value

Here you can Listing, and view individual product option value. And can create product option value with media url or without media.

List

Returns a collection of Product option value

Filtering

You can filter your results as follows:

List of product option value for specific id(s)
  • /product-option-values?filter[id]=1
  • /product-option-values?filter[id]=1,2,3
List of product option value for specific name(s)
  • /product-option-values?filter[name]=B
  • /product-option-values?filter[name]=B,I
List of product option value for specific handle(s)
  • /product-option-values?filter[handle]=B
  • /product-option-values?filter[handle]=B,I

Example of listing product option value

Request

GET /product-option-values HTTP/1.1

Response

{
	"data": [
		{
			"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": 14,
			"handle": "M",
			"name": {
				"de": "M",
				"en": "M"
			},
			"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": 13,
			"handle": "orange",
			"name": {
				"de": "orange",
				"en": "orange"
			},
			"option_type": 2,
			"media": [
				199
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:20+00:00",
			"updated_at": "2023-01-10T10:11:20+00:00"
		},
		{
			"id": 12,
			"handle": "lime",
			"name": {
				"de": "lime",
				"en": "lime"
			},
			"option_type": 2,
			"media": [
				194
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:20+00:00",
			"updated_at": "2023-01-10T10:11:20+00:00"
		},
		{
			"id": 11,
			"handle": "green",
			"name": {
				"de": "green",
				"en": "green"
			},
			"option_type": 2,
			"media": [
				189
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:19+00:00",
			"updated_at": "2023-01-10T10:11:19+00:00"
		},
		{
			"id": 10,
			"handle": "blue",
			"name": {
				"de": "blue",
				"en": "blue"
			},
			"option_type": 2,
			"media": [
				184
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:19+00:00",
			"updated_at": "2023-01-10T10:11:19+00:00"
		},
		{
			"id": 9,
			"handle": "cyan",
			"name": {
				"de": "cyan",
				"en": "cyan"
			},
			"option_type": 2,
			"media": [
				179
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:19+00:00",
			"updated_at": "2023-01-10T10:11:19+00:00"
		},
		{
			"id": 8,
			"handle": "pink",
			"name": {
				"de": "pink",
				"en": "pink"
			},
			"option_type": 2,
			"media": [
				174
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:19+00:00",
			"updated_at": "2023-01-10T10:11:19+00:00"
		},
		{
			"id": 7,
			"handle": "yellow",
			"name": {
				"de": "yellow",
				"en": "yellow"
			},
			"option_type": 2,
			"media": [
				169
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:19+00:00",
			"updated_at": "2023-01-10T10:11:19+00:00"
		},
		{
			"id": 6,
			"handle": "black",
			"name": {
				"de": "black",
				"en": "black"
			},
			"option_type": 2,
			"media": [
				164
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:18+00:00",
			"updated_at": "2023-01-10T10:11:18+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"
		},
		{
			"id": 4,
			"handle": "red",
			"name": {
				"de": "red",
				"en": "red"
			},
			"option_type": 2,
			"media": [
				154
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:18+00:00",
			"updated_at": "2023-01-10T10:11:18+00:00"
		},
		{
			"id": 3,
			"handle": "purple",
			"name": {
				"de": "purple",
				"en": "purple"
			},
			"option_type": 2,
			"media": [
				149
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:18+00:00",
			"updated_at": "2023-01-10T10:11:18+00:00"
		},
		{
			"id": 2,
			"handle": "S",
			"name": {
				"de": "S",
				"en": "S"
			},
			"option_type": 1,
			"media": [],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:18+00:00",
			"updated_at": "2023-01-10T10:11:18+00:00"
		},
		{
			"id": 1,
			"handle": "gray",
			"name": {
				"de": "gray",
				"en": "gray"
			},
			"option_type": 2,
			"media": [
				144
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:17+00:00",
			"updated_at": "2023-01-10T10:11:17+00:00"
		}
	],
	"links": {
		"first": null,
		"last": null,
		"prev": null,
		"next": null
	},
	"meta": {
		"path": "https://api.smake.io/master-administration/product-option-values",
		"per_page": 15,
		"next_cursor": null,
		"prev_cursor": null
	}
}

Example of listing product option values with filter

Request

GET /product-option-values?filter[id]=1,2 HTTP/1.1

Response

{
	"data": [
		{
			"id": 2,
			"handle": "S",
			"name": {
				"de": "S",
				"en": "S"
			},
			"option_type": 1,
			"media": [],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:18+00:00",
			"updated_at": "2023-01-10T10:11:18+00:00"
		},
		{
			"id": 1,
			"handle": "gray",
			"name": {
				"de": "gray",
				"en": "gray"
			},
			"option_type": 2,
			"media": [
				144
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:17+00:00",
			"updated_at": "2023-01-10T10:11:17+00:00"
		}
	],
	"links": {
		"first": null,
		"last": null,
		"prev": null,
		"next": null
	},
	"meta": {
		"path": "https://api.smake.io/master-administration/product-option-values",
		"per_page": 15,
		"next_cursor": null,
		"prev_cursor": null
	}
}

Example of listing product option values with expanded relation

Allowed relation expansion is media and option_type.

Request

GET /product-option-values?expand=option_type HTTP/1.1

Response

{
	"data": [
		{
			"id": 15,
			"handle": "L",
			"name": {
				"de": "L",
				"en": "L"
			},
			"option_type": {
				"id": 1,
				"handle": "size",
				"name": {
					"de": "voluptatem ut corporis",
					"en": "est"
				},
				"created_at": "2023-01-10T10:11:10+00:00",
				"updated_at": "2023-01-10T10:11:10+00:00"
			},
			"media": [],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:20+00:00",
			"updated_at": "2023-01-10T10:11:20+00:00"
		},
		{
			"id": 14,
			"handle": "M",
			"name": {
				"de": "M",
				"en": "M"
			},
			"option_type": {
				"id": 1,
				"handle": "size",
				"name": {
					"de": "voluptatem ut corporis",
					"en": "est"
				},
				"created_at": "2023-01-10T10:11:10+00:00",
				"updated_at": "2023-01-10T10:11:10+00:00"
			},
			"media": [],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:20+00:00",
			"updated_at": "2023-01-10T10:11:20+00:00"
		},
		{
			"id": 13,
			"handle": "orange",
			"name": {
				"de": "orange",
				"en": "orange"
			},
			"option_type": {
				"id": 2,
				"handle": "color",
				"name": {
					"de": "ut",
					"en": "consequuntur"
				},
				"created_at": "2023-01-10T10:11:10+00:00",
				"updated_at": "2023-01-10T10:11:10+00:00"
			},
			"media": [
				199
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:20+00:00",
			"updated_at": "2023-01-10T10:11:20+00:00"
		},
		{
			"id": 12,
			"handle": "lime",
			"name": {
				"de": "lime",
				"en": "lime"
			},
			"option_type": {
				"id": 2,
				"handle": "color",
				"name": {
					"de": "ut",
					"en": "consequuntur"
				},
				"created_at": "2023-01-10T10:11:10+00:00",
				"updated_at": "2023-01-10T10:11:10+00:00"
			},
			"media": [
				194
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:20+00:00",
			"updated_at": "2023-01-10T10:11:20+00:00"
		},
		{
			"id": 11,
			"handle": "green",
			"name": {
				"de": "green",
				"en": "green"
			},
			"option_type": {
				"id": 2,
				"handle": "color",
				"name": {
					"de": "ut",
					"en": "consequuntur"
				},
				"created_at": "2023-01-10T10:11:10+00:00",
				"updated_at": "2023-01-10T10:11:10+00:00"
			},
			"media": [
				189
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:19+00:00",
			"updated_at": "2023-01-10T10:11:19+00:00"
		},
		{
			"id": 10,
			"handle": "blue",
			"name": {
				"de": "blue",
				"en": "blue"
			},
			"option_type": {
				"id": 2,
				"handle": "color",
				"name": {
					"de": "ut",
					"en": "consequuntur"
				},
				"created_at": "2023-01-10T10:11:10+00:00",
				"updated_at": "2023-01-10T10:11:10+00:00"
			},
			"media": [
				184
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:19+00:00",
			"updated_at": "2023-01-10T10:11:19+00:00"
		},
		{
			"id": 9,
			"handle": "cyan",
			"name": {
				"de": "cyan",
				"en": "cyan"
			},
			"option_type": {
				"id": 2,
				"handle": "color",
				"name": {
					"de": "ut",
					"en": "consequuntur"
				},
				"created_at": "2023-01-10T10:11:10+00:00",
				"updated_at": "2023-01-10T10:11:10+00:00"
			},
			"media": [
				179
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:19+00:00",
			"updated_at": "2023-01-10T10:11:19+00:00"
		},
		{
			"id": 8,
			"handle": "pink",
			"name": {
				"de": "pink",
				"en": "pink"
			},
			"option_type": {
				"id": 2,
				"handle": "color",
				"name": {
					"de": "ut",
					"en": "consequuntur"
				},
				"created_at": "2023-01-10T10:11:10+00:00",
				"updated_at": "2023-01-10T10:11:10+00:00"
			},
			"media": [
				174
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:19+00:00",
			"updated_at": "2023-01-10T10:11:19+00:00"
		},
		{
			"id": 7,
			"handle": "yellow",
			"name": {
				"de": "yellow",
				"en": "yellow"
			},
			"option_type": {
				"id": 2,
				"handle": "color",
				"name": {
					"de": "ut",
					"en": "consequuntur"
				},
				"created_at": "2023-01-10T10:11:10+00:00",
				"updated_at": "2023-01-10T10:11:10+00:00"
			},
			"media": [
				169
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:19+00:00",
			"updated_at": "2023-01-10T10:11:19+00:00"
		},
		{
			"id": 6,
			"handle": "black",
			"name": {
				"de": "black",
				"en": "black"
			},
			"option_type": {
				"id": 2,
				"handle": "color",
				"name": {
					"de": "ut",
					"en": "consequuntur"
				},
				"created_at": "2023-01-10T10:11:10+00:00",
				"updated_at": "2023-01-10T10:11:10+00:00"
			},
			"media": [
				164
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:18+00:00",
			"updated_at": "2023-01-10T10:11:18+00:00"
		},
		{
			"id": 5,
			"handle": "white",
			"name": {
				"de": "white",
				"en": "white"
			},
			"option_type": {
				"id": 2,
				"handle": "color",
				"name": {
					"de": "ut",
					"en": "consequuntur"
				},
				"created_at": "2023-01-10T10:11:10+00:00",
				"updated_at": "2023-01-10T10:11:10+00:00"
			},
			"media": [
				159
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:18+00:00",
			"updated_at": "2023-01-10T10:11:18+00:00"
		},
		{
			"id": 4,
			"handle": "red",
			"name": {
				"de": "red",
				"en": "red"
			},
			"option_type": {
				"id": 2,
				"handle": "color",
				"name": {
					"de": "ut",
					"en": "consequuntur"
				},
				"created_at": "2023-01-10T10:11:10+00:00",
				"updated_at": "2023-01-10T10:11:10+00:00"
			},
			"media": [
				154
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:18+00:00",
			"updated_at": "2023-01-10T10:11:18+00:00"
		},
		{
			"id": 3,
			"handle": "purple",
			"name": {
				"de": "purple",
				"en": "purple"
			},
			"option_type": {
				"id": 2,
				"handle": "color",
				"name": {
					"de": "ut",
					"en": "consequuntur"
				},
				"created_at": "2023-01-10T10:11:10+00:00",
				"updated_at": "2023-01-10T10:11:10+00:00"
			},
			"media": [
				149
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:18+00:00",
			"updated_at": "2023-01-10T10:11:18+00:00"
		},
		{
			"id": 2,
			"handle": "S",
			"name": {
				"de": "S",
				"en": "S"
			},
			"option_type": {
				"id": 1,
				"handle": "size",
				"name": {
					"de": "voluptatem ut corporis",
					"en": "est"
				},
				"created_at": "2023-01-10T10:11:10+00:00",
				"updated_at": "2023-01-10T10:11:10+00:00"
			},
			"media": [],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:18+00:00",
			"updated_at": "2023-01-10T10:11:18+00:00"
		},
		{
			"id": 1,
			"handle": "gray",
			"name": {
				"de": "gray",
				"en": "gray"
			},
			"option_type": {
				"id": 2,
				"handle": "color",
				"name": {
					"de": "ut",
					"en": "consequuntur"
				},
				"created_at": "2023-01-10T10:11:10+00:00",
				"updated_at": "2023-01-10T10:11:10+00:00"
			},
			"media": [
				144
			],
			"media_state": "empty",
			"created_at": "2023-01-10T10:11:17+00:00",
			"updated_at": "2023-01-10T10:11:17+00:00"
		}
	],
	"links": {
		"first": null,
		"last": null,
		"prev": null,
		"next": null
	},
	"meta": {
		"path": "https://api.smake.io/master-administration/product-option-values",
		"per_page": 15,
		"next_cursor": null,
		"prev_cursor": null
	}
}

GET

Returns the product option value with the id = x.

Example of get a specific product option value

Request

GET /product-option-values/3 HTTP/1.1

Response

{
	"id": 3,
	"handle": "purple",
	"name": {
		"de": "purple",
		"en": "purple"
	},
	"option_type": 2,
	"media": [
		149
	],
	"media_state": "empty",
	"created_at": "2023-01-10T10:11:18+00:00",
	"updated_at": "2023-01-10T10:11:18+00:00"
}

Example of get a specific product option value with expanded relation

Request

GET /product-option-values/3?expand=media HTTP/1.1

Response

{
	"id": 3,
	"handle": "purple",
	"name": {
		"de": "purple",
		"en": "purple"
	},
	"option_type": 2,
	"media": [
		{
			"id": 149,
			"collection_name": "preview",
			"file_name": "production-option-value-purple.png",
			"size": 248,
			"mime_type": "image/png",
			"download_url": "https://api.smake.io/temporary-url?expires=1673876581&path=files%2Ff494d888c0ec4fdea75ba673514f58a2%2Fproduction-option-value-purple.png&signature=d27e675cbf1dc4cbd2ade93024149e5e8381d5ea117303d72dc8e01e2b48eabf",
			"state": "pending",
			"requested": null,
			"failure_message": null,
			"created_at": "2023-01-10T10:11:18+00:00",
			"updated_at": "2023-01-10T10:11:18+00:00"
		}
	],
	"media_state": "empty",
	"created_at": "2023-01-10T10:11:18+00:00",
	"updated_at": "2023-01-10T10:11:18+00:00"
}

CREATE

You can create product option value with media url or without media url.

Background processing

When you create a product option value with media url, this will create media asynchronously via a background job. You will receive the new media id in response.

The current state of the asynchronous process is represented due following states:

State Meaning
empty The initial state of a new media for product option value.
checking Media is processed automatically in background. For example images will be generated or downloaded.
failed Something went wrong during the checking process.
completed All automatic processes were successful. The media is ready to use for product option value.

Media Array

The request field media is always an array of media url and optional. And allowed medias are jpeg, jpg & png.

Field Type Description Required
collection_name string Unique identifier for the intended use. sometimes
url string Url which references a file. This file will be downloaded and attached to the resource. sometimes

Example of creating a product option value with media

Request

POST /product-option-values HTTP/1.1

{
  "handle": "Q3",
  "name":
		{
		"de": "Q3",
		"en" : "Q3"
		},
  "option_type": {
    "handle": "size"
  },
	"media" : [
    {
      "url": "https://cdn.pixabay.com/photo/2016/12/26/18/33/logo-1932539__340.png",
      "collection_name": "preview"
    }
  ]
}

Response

{
	"id": 16,
	"handle": "Q3",
	"name": {
		"de": "Q3",
		"en": "Q3"
	},
	"option_type": 1,
	"media": [
		1914
	],
	"media_state": "checking",
	"created_at": "2023-01-16T12:54:09+00:00",
	"updated_at": "2023-01-16T12:54:09+00:00"
}

Example of creating a product option value without media

Request

POST /product-option-values HTTP/1.1

{
  "handle": "Q",
  "name":
		{
		"de": "Q",
		"en" : "Q"
		},
  "option_type": {
    "handle": "size"
  }
}

Response

{
	"id": 17,
	"handle": "Q",
	"name": {
		"de": "Q",
		"en": "Q"
	},
	"option_type": 1,
	"media": [],
	"media_state": "empty",
	"created_at": "2023-01-16T13:07:44+00:00",
	"updated_at": "2023-01-16T13:07:44+00:00"
}