Options
Get Shared Options
GET https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/shared-product-optionsRequest
Get all shared options in the Catalog.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- page in query - integerSpecifies the page number in a limited (paginated) list of products.
- limit in query - integer
Controls the number of items per page in a limited (paginated) list of products.
- id in query - integer
Filter items by id.
- name in query - string
Filter items by name.
- storefront_name in query - string
Filter items by storefront_name.
- type in query - stringFilter items by type.
Allowed: swatch | radio_buttons | rectangles | dropdown
- sort in query - stringSort items.
Allowed: id | name | storefront_name | type
example
curl --request GET \
--url 'https://api.bigcommerce.com/stores/[store_hash]/v3/catalog/shared-product-options' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: {{token}}'
Response
An array of shared options and metadata.
Body
object | application/json
dataarray[object]
required
example
{
"data": [
{
"id": 3,
"name": "Sleeve length",
"storefront_name": "Sleeve length",
"type": "rectangles",
"option_type": "variant_option",
"values": [
{
"id": 5,
"label": "Long",
"sort_order": 0,
"is_default": true
},
{
"id": 6,
"label": "Short",
"sort_order": 1,
"is_default": false
}
],
"associated_products_qty": 1,
"associated_products": [
{
"id": "3"
}
]
}
],
"meta": {
Create Shared Options (Batch)
POST https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/shared-product-optionsRequest
Create shared options in bulk.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
Body
array | application/json
namestring
requiredThe unique name identifying the shared option in the control panel. Name is unique within a store.>= 1 characters<= 255 charactersExample: Fabric materialstorefront_namestring
requiredThe text display identifying the shared option on the storefront.>= 1 characters<= 255 charactersExample: Fabrictypestring
requiredType of shared option.
Each type has a unique display style on the storefront.
For an explanation of each type, see the Overview.
Allowed: dropdown | rectangles | radio_buttons | swatch
valuesarray[object]
Data describing option values.
example
[
{
"name": "size",
"storefront_name": "Shirt size",
"type": "rectangles",
"values": [
{
"label": "Small",
"sort_order": 1,
"is_default": true
},
{
"label": "Large",
"sort_order": 2,
"is_default": false
}
]
}
]
Response
An array of
SharedProductOption
objects.Body
object | application/json
dataarray[object]
required
example
{
"data": [
{
"id": 45,
"name": "size",
"storefront_name": "Shirt size",
"type": "rectangles",
"option_type": "variant_option",
"values": [
{
"id": 50,
"label": "Small",
"sort_order": 1,
"is_default": true
},
{
"id": 51,
"label": "Large",
"sort_order": 2,
"is_default": false
}
],
"associated_products_qty": 0,
"associated_products": []
}
],
"meta": {}
}
Update Shared Options (Batch)
PUT https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/shared-product-optionsRequest
Bulk update shared options using option IDs.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
Body
array | application/json
namestring
requiredThe unique name identifying the shared option in the control panel. Name is unique within a store.>= 1 characters<= 255 charactersExample: Fabric materialstorefront_namestring
requiredThe text display identifying the shared option on the storefront.>= 1 characters<= 255 charactersExample: Fabrictypestring
requiredType of shared option.
Each type has a unique display style on the storefront.
For an explanation of each type, see the Overview.
Allowed: dropdown | rectangles | radio_buttons | swatch
valuesarray[object]
Data describing option values.
idinteger
The unique numeric ID of the value; increments sequentially.
example
[
{
"id": 45,
"name": "size",
"storefront_name": "Shirt size",
"type": "rectangles",
"values": [
{
"id": 50,
"label": "Dual color",
"sort_order": 1,
"is_default": true
},
{
"id": 51,
"label": "Single color",
"sort_order": 2,
"is_default": false
}
]
}
]
Response
An array of
SharedProductOption
objects.Body
object | application/json
dataarray[object]
required
example
{
"data": [
{
"id": 45,
"name": "size",
"storefront_name": "Shirt size",
"type": "rectangles",
"option_type": "variant_option",
"values": [
{
"id": 50,
"label": "Dual color",
"sort_order": 1,
"is_default": true
},
{
"id": 51,
"label": "Single color",
"sort_order": 2,
"is_default": false
}
],
"associated_products_qty": 0,
"associated_products": []
}
],
"meta": {}
}
Delete Shared Options
DELETE https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/shared-product-optionsRequest
Delete shared options by ID, for example,
?id:in=1,2,3
.Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- id:in in query - stringrequired
example
curl --request DELETE \
--url 'https://api.bigcommerce.com/stores/[store_hash]/v3/catalog/shared-product-options' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: {{token}}'
Response
An empty response.
Get a Shared Option
GET https://api.bigcommerce.com/stores/{store_hash}/v3/catalog/shared-product-options/{option_id}Request
Get a shared option by option ID.
Authentication
- X-Auth-Token in header
Parameters
- store_hash in path - string
- option_id in path - integerrequiredThe ID of the
Shared Option
to which the resource belongs.
example
curl --request GET \
--url 'https://api.bigcommerce.com/stores/[store_hash]/v3/catalog/shared-product-options/[option_id]' \
--header 'Content-Type: application/json' \
--header 'X-Auth-Token: {{token}}'
Response
A
SharedProductOption
object.Body
object | application/json
dataobject
requiredCommon Option properties.
example
{
"data": {
"id": 45,
"name": "size",
"storefront_name": "Shirt size",
"type": "rectangles",
"option_type": "variant_option",
"values": [
{
"id": 50,
"label": "Dual color",
"sort_order": 1,
"is_default": true
},
{
"id": 51,
"label": "Single color",
"sort_order": 2,
"is_default": false
}
],
"associated_products_qty": 0,
"associated_products": []
},
"meta": {}
}
Did you find what you were looking for?