Product Variant Option
Information
The product_variant_options
resource type is any combination of a product_variant
, variant_attribute
, and variant_value
.
To create a product_variant_option
, you will need the IDs for each of the following:
- The
product_variant
it belongs to - The
variant_attribute
that will describe theproduct_variant
- The
variant_value
that will describe theproduct_variant
API Requests
The request types and routes available for this resource as well as details on how to structure your requests are below. See API Reference - ProductVariantOption for examples on how the requests might look in various languages and to test the requests in the browser.
Request | Route | Description |
---|---|---|
POST | /catalog/v1/product_variant_options | Create a new product_variant_option |
GET | /catalog/v1/product_variant_options | Request the information for all product_variant_options (see Note 1 below) |
GET | /catalog/v1/product_variant_options/:id | Request the information for a particular product_variant_option |
PATCH | /catalog/v1/product_variant_options/:id | Update an existing product_variant_option |
DELETE | /catalog/v1/product_variant_options/:id | Delete an existing product_variant_option |
This will return all ProductVariantOptions that belong to your Organization as well as all ProductVariantOptions that belong to a Master Brand. You can use
filter[product_variant_id]
to narrow down the results by a ProductVariant that belongs to your Organization.
POST
To create a ProductVariantOption, send a payload with the below structure to
/catalog/v1/product_variant_options?scope_by[organization_id]=ORGANIZATION_ID
.
{
"data": {
"type": "product_variant_options",
"attributes":{},
"relationships": {
"product_variant": {
"data":{
"type":"product_variants",
"id":"PRODUCT_VARIANT_ID"
}
},
"variant_attribute": {
"data": {
"type":"variant_attributes",
"id":"VARIANT_ATTRIBUTE_ID"
}
},
"variant_value": {
"data": {
"type": "variant_values",
"id":"VARIANT_VALUE_ID"
}
}
}
}
}
Path
scope_by[organization_id] string
Required. Organization UUID.
Attributes
id string
Optional. UUID for the resource.
Relationships
ProductVariant
product_variant_id string
Required. Related ProductVariant UUID.
type string
Required. Must be product_variants
.
VariantAttribute
variant_attribute_id string
Required. Related VariantAttribute UUID.
type string
Required. Must be variant_attributes
.
VariantValue
variant_value_id string
Required. Related VariantValue UUID.
type string
Required. Must be variant_values
.
GET Index
To fetch all ProductVariantOptions, send a request to
/catalog/v1/product_variant_options?scope_by[organization_id]=ORGANIZATION_ID
. By default, we only return the first 10 results from the request. You can adjust the number of returned results with page[size]
, or adjust the returned page with page[page]
.
Path
scope_by[organization_id] string
Required. Organization UUID.
page[size] int32
Optional. Number of elements per page.
page[page] int32
Optional. Number of the page.
filter[product_variant_id] string
Optional. Filters by ProductVariant UUID.
GET Show
To fetch a ProductVariantOption, send a request to
/catalog/v1/product_variant_options/PRODUCT_VARIANT_OPTION_ID?scope_by[organization_id]=ORGANIZATION_ID
.
Path
scope_by[organization_id] string
Required. Organization UUID.
product_variant_option_id string
Required. ProductVariantOption UUID you want to fetch.
PATCH
To update a ProductVariantOption, send a payload with the below structure to
/catalog/v1/product_variant_options/PRODUCT_VARIANT_OPTION_ID?scope_by[organization_id]=ORGANIZATION_ID
.
{
"data": {
"type": "product_variant_options",
"id": "PRODUCT_VARIANT_OPTION_ID"
"attributes":{},
"relationships": {
"product_variant": {
"data":{
"type":"product_variants",
"id":"PRODUCT_VARIANT_ID"
}
},
"variant_attribute": {
"data": {
"type":"variant_attributes",
"id":"VARIANT_ATTRIBUTE_ID"
}
},
"variant_value": {
"data": {
"type": "variant_values",
"id":"VARIANT_VALUE_ID"
}
}
}
}
}
Path
scope_by[organization_id] string
Required. Organization UUID.
id string
Optional. UUID for the resource.
Attributes
There are no attributes needed for a PATCH call.
Relationships
ProductVariant
product_variant_id string
Required. Related ProductVariant UUID.
type string
Required. Must be product_variants
.
VariantAttribute
variant_attribute_id string
Required. Related VariantAttribute UUID.
type string
Required. Must be variant_attributes
.
VariantValue
variant_value_id string
Required. Related VariantValue UUID.
type string
Required. Must be variant_values
.
DELETE
To delete a ProductVariantOption, send a request to
/catalog/v1/product_variant_options/PRODUCT_VARIANT_OPTION_ID?scope_by[organization_id]=ORGANIZATION_ID
.
Path
scope_by[organization_id] string
Required. Organization UUID.
product_variant_option_id string
Required. ProductVariantOption UUID you want to delete.
Updated 11 months ago