CategoryOptions Resource
Use the CategoryOptions
resource to fetch the item options associated with a given category. They can be used in tandem with the option_choices
filter on the ItemList
resource.
Resources:
Schema type
Use category-options
to reference this resource in the template schema.
Querying
Filters required
-
category_id string
id
of aCategory
to fetch options for.{ "filters": { "category_id": "II4VPMMREFDLJ27TKULXOVMS" } }
Output
{
"__SO_RESOURCE_TYPE__": "category_options", // internally used resource property. do not modify.
"id": "FPWZK5NMPZSUJ6V2SKYMYKS7",
"square_online_id": "11ee258c917fe77e87a4a2491ad79fa8",
"resource_type": "CATEGORY_OPTION",
"option_type": "string",
"deprecated": false,
"name": "Size",
"display_name": "Size",
"description": null,
"renderer": "dropdown",
"created_at": "2023-08-15T18:38:42+00:00",
"updated_at": "2023-08-15T18:38:42+00:00",
"item_count": 1,
"choices": [
{
"id": "P4SVFCWEOVEHBBBXXMEGTCIN",
"square_online_id": "11ee258c9180187087dda2491ad79fa8"
"deprecated": false,
"display_order": 0,
"name": "Large",
"description": null,
"color": null,
"item_count": 1,
"created_at": "2023-08-15T18:38:42+00:00",
"updated_at": "2023-08-15T18:38:42+00:00"
},
{
"id": "O27GN3NSHQRA4CJ5RASL3SMX",
"square_online_id": "11ee258c9180243c9369a2491ad79fa8",
"deprecated": false,
"display_order": 1,
"name": "Medium",
"description": null,
"color": null,
"item_count": 1,
"created_at": "2023-08-15T18:38:42+00:00",
"updated_at": "2023-08-15T18:38:42+00:00"
},
{
"id": "6OWFBPEX6ADGOBKSWYB2QF7P",
"square_online_id": "11ee258c91802c4899c6a2491ad79fa8",
"deprecated": false,
"display_order": 2,
"name": "Small",
"description": null,
"color": null,
"item_count": 1,
"created_at": "2023-08-15T18:38:42+00:00",
"updated_at": "2023-08-15T18:38:42+00:00"
}
]
}
CategoryOptions resources
CategoryOptions
Item options for a category.
Field | Type | Description |
---|---|---|
choices | Choice[] | List of choices for this option set |
created_at | String | Date at which the resource was created |
deprecated | Boolean | A self reminding flag to no longer assign this option to item and its variations.Has no affect on existing items. API will not filter these out. |
description | String | A sentence describing the option |
display_name | String | A non-unique external name of this option. This is used when displaying to buyers (on published sites). |
id | String | Option set ID in Square |
square_online_id | String | Option set ID in Square Online |
item_count | Number | The number of items that use this option set |
name | String | A unique internal name of this option. Should only be displayed to the seller, when managing. |
renderer | String | The renderer type. A color type option set can only have tiles as its renderer. |
resource_type | String | The resource type identifier. |
option_type | String | The option type. |
updated_at | String | Date at which the resource was last updated |
Choice
A choice in list of category options.
Field | Type | Description |
---|---|---|
color | String | Contains the hex color value when the set is a color type |
created_at | String | Date at which the option set choice was created |
deprecated | Boolean | A self reminding flag to no longer assign this choice to item and its variations.Has no affect on existing items. API will not filter these out. |
description | String | Description of the choice |
display_order | Number | The order in which this choice should be displayed relative to other choices in the set |
id | String | Option set choice ID in Square |
square_online_id | String | Option set choice ID in Square Online |
item_count | Number | The number of items that this option set choice applies to |
name | String | Name for the choice, does not need to be unique. |
updated_at | String | Date at which the option set choice was last updated |