Hello,
I am having a problem figuring out how to use your API to match variants with their associated options/attributes.
For example, lets say I have an item with variants called Shirt with an attribute Size and option Small and another attribute Color with option Red and Blue. This would create two variants called 'Shirt Small Red' and 'Shirt Small Blue'.
Is there somewhere in the API that tells you what attributes and options are associated with a specific variant? When using something like the item_groups endpoint you can get a response like.
{
"id": "",
"name": "shirt",
"items": {
"elements": [
{
"id": "123",
"hidden": false,
"itemGroup": {
"id": ""
},
"name": "shirt red small",
"alternateName": "",
"code": "",
"sku": "",
"price": 1,
"priceType": "FIXED",
"defaultTaxRates": true,
"unitName": "",
"isRevenue": true,
"modifiedTime": 1452694038000
},
{
"id": "",
"hidden": false,
"itemGroup": {
"id": ""
},
"name": "shirt blue small",
"alternateName": "",
"code": "",
"sku": "",
"price": 1,
"priceType": "FIXED",
"defaultTaxRates": true,
"unitName": "",
"isRevenue": true,
"modifiedTime": 1452693218000
}
]
},
"attributes": {
"elements": [
{
"id": "",
"name": "color",
"itemGroup": {
"id": ""
}
},
{
"id": "",
"name": "size",
"itemGroup": {
"id": ""
}
}
]
}
}
Which gives some helpful information but from what I can see this only gives you the possible option and attributes for an item group and not which ones belong to which variant. Is there a way to figure out that the name 'shirt red small' is made up of an attribute 'Color' with option 'Red' and an attribute 'Size' with option 'Small'. I guess what I am looking for is something like this.
{
"id": "",
"name": "shirt",
"items": {
"elements": [
{
"id": "123",
"hidden": false,
"itemGroup": {
"id": ""
},
"name": "shirt red small",
"alternateName": "",
"code": "",
"sku": "",
"price": 1,
"priceType": "FIXED",
"defaultTaxRates": true,
"unitName": "",
"isRevenue": true,
"modifiedTime": 1452694038000,
"options": [
{
"name": 'Color',
"value": 'Red'
},
{
"name": 'Size'
"value": 'Small'
}
]
}
]
}
}
Thanks for any help!