A product variant is a specific product version with a unique combination of product option values.
{
"created_at": 1678887627,
"deleted": false,
"description": "T-shirt for men",
"external_name": "Red Small T-shirt1678887627471",
"id": "01GVJR0ASC2AB80F7KATTCMWFB",
"metadata": {
"brand": "HRX"
},
"name": "Red S T-shirt1678887627471",
"object": "variant",
"option_values": [
{
"name": "color",
"value": "red"
},
{
"name": "size",
"value": "s"
}
],
"product_id": "01GVJR0A1TZ5AMR6PPBEG85Q09",
"resource_version": 1678887627621,
"sku": "sku-12346780",
"status": "active",
"updated_at": 1678887627
}This API is used for creating a new product variant.
The following table will help you to understand the state of the variant status after passing status value during variant creation.
Parameter Value column holds possible inputs to the variant.status.
Product Status column states the status of the associated product.
Variant Status column states the value of the variant status once the variant is created.
| Parameter Value | Product Status | Variant Status |
| No value passed | active | active |
| No value passed | inactive | inactive |
| Value passed as active | active | active |
| Value passed as inactive | active | inactive |
| Value passed as active | inactive | not allowed |
| Value passed as inactive | inactive | inactive |
This API is used to retrieve a product variant using variant_id
.
This API is used to modify a product variant.
This API deletes a product variant and returns the delete attribute value as true
. Deletion of a product variant is not allowed if there are active
or archived
item_price_id
under the variant. Once the variant is deleted, the id
and name
of the product variant can be reused.
This API retrieves the list of product variants.