Get product variants attributes
GET
/productvariants/list.json
GET
/productvariants/list.json
$storeden = new Storeden\Storeden($config);
$products_list = $storeden->get('/productvariants/list.json');
[
{
"key": "color",
"values": {
"pink": {
"value": "pink",
"img": ""
},
"black": {
"value": "black",
"img": "https:\/\/tcdn.storeden.com\/gallery\/5b23c42b16f46ad5418b456e"
},
...
}
},
...
]
PUT
/productvariants/variantimage.json
key required (string) | Variant key (for example: color) |
value required (string) | Variant entry (for example: black) |
image_id required (StoredenID) | Unique id of image resource ( see: Gallery API ) |
{
"ok": 1,
"err": null,
"nModified": 56
}
GET
/productvariants/variantgallery.json
uid required (int) | Unique item uid |
sku required (string) | Variant specific SKU |
$storeden = new Storeden\Storeden($config);
$products_list = $storeden->get('/productvariants/variantgallery.json?uid=1724183&SKU=red-xl-tshirt');
{
"uid": 1724183,
"variant": {
"gallery": [
"https://egress.storeden.net/gallery/56d59a4b02e58e0370a942d5",
"https://egress.storeden.net/gallery/56d59a4b02e58e0370a942d6",
"https://egress.storeden.net/gallery/56d59a4b02e58e0370a942ef"
],
"sku": "red-xl-tshirt"
}
}
PUT
/productvariants/variantgallery.json
uid required (int) | Unique item uid |
sku required (string) | Variant specific SKU |
gallery[] required (StoredenID|url) *multiple | Specify full url of image or image StoredenID previously uploaded into Gallery |
$storeden = new Storeden\Storeden($config);
$payload = array();
$payload['uid'] = 1724183;
$payload['sku'] = 'red-xl-tshirt';
$pyaload['gallery'] = [];
$payload['gallery'][] = 'https://egress.storeden.net/gallery/56d59a4b02e58e0370a942d5';
$payload['gallery'][] = '56d59a4b02e58e0370a942d6';
$payload['gallery'][] = '56d59a4b02e58e0370a942ef';
$products_list = $storeden->put('/productvariants/variantgallery.json', $payload);
{
"inserted": {
"status": {
"ok": 1,
"nModified": 1,
"n": 1,
"err": null,
"errmsg": null,
"updatedExisting": true
},
"urls": [
"https://egress.storeden.net/gallery/56d59a4b02e58e0370a942d6",
"https://egress.storeden.net/gallery/56d59a4b02e58e0370a942d5",
"https://egress.storeden.net/gallery/56d59a4b02e58e0370a942ef"
]
}
}
GET
/productvariants/variantTranslation.json
variant required (string) | Your variant name |
$storeden = new Storeden\Storeden($config);
$variant_translations = $storeden->get('/productvariants/variantTranslation.json?variant=Colore');
{
"variant": {
"label": "Colore",
"translations": {
"it_IT": "Colore",
"en_US": "Color",
"es_ES": null
}
},
"variantValues": [
{
"label": "rosso",
"translations": {
"it_IT": "Rosso",
"en_US": "Red",
"es_ES": null
},
"image": null
},
{
"label": "giallo",
"translations": {
"it_IT": "Giallo",
"en_US": "Yellow",
"es_ES": null
},
"image": null
},
{
"label": "verde",
"translations": {
"it_IT": "Verde",
"en_US": "Green",
"es_ES": null
},
"image": "https://tcdn.storeden.com/gallery/5b58910e16f46af008b410f0"
},
{
"label": "blue",
"translations": {
"it_IT": null,
"en_US": null,
"es_ES": null
},
"image": null
}
],
"locales": {
"it_IT": "Italiano",
"en_US": "Inglese",
"es_ES": "Spagnolo"
}
}
Please note that this api endpoint is currently in beta stage.
This endpoint overwrite all the translations of the specified "variant"
POST
/productvariants/variantTranslation.json
variant required (string) | Your variant name |
variantTranslation[TLD] required (string) | Replace TLD with iso code of translated content ( eg: en_US ) |
variantValueTranslations[VARIANT_VALUE][image] (string) | replace VARIANT_VALUE with the correct variant label |
variantValueTranslations[VARIANT_VALUE][translations][TLD] (string) | Replace TLD with iso code of translated content ( eg: en_US ), replace VARIANT_VALUE with the correct variant label |
$storeden = new Storeden\Storeden($config);
$payload = array();
$payload['variant'] = 'Colore';
$payload['variantTranslations'] = array(
'it_IT' => 'Colore del prodotto',
'en_US' => 'Product color'
);
$payload['variantValueTranslations'] = array(
'giallo' = array(
'image' => 'https://egress.storeden.net/gallery/111',
'translations' => array(
'it_IT' => 'Giallo',
'en_US' => 'Yellow',
'es_ES' => 'Amarillo'
)
),
'rosso' = array(
'image' => 'https://egress.storeden.net/gallery/222',
'translations' => array(
'it_IT' => 'Rosso',
'en_US' => 'Red'
)
),
'blue' = array(
'image' => 'https://egress.storeden.net/gallery/333',
'translations' => array(
'it_IT' => 'Blu',
'en_US' => 'Blue'
)
)
);
$variant_update = $storeden->post('/productvariants/variantTranslation.json', $payload);
{
"itemsCount": 2,
"nModified": 2
}