Product.updateImageCollection
- Used to update product image collection. How it should work: -- Shop must download & add to it's side any image that wasn't previously added. -- Shop must delete from it's side any image that's missing from the request. -- Shop must apply the same order as sent in the array.
- SC always sends images of a single product set in each request.
For the suggested flow in the venture side, please check this flow chart
Note: The display order is taken from the images array, it should always be correctly-ordered before sending the request.
Request
JSON example: Note: productSetSrctId + hash should be considered the unique identifier for identifying images in the Shop side.
{
"api":1,
"method":"Product.updateImageCollection",
"params":{
"productSetSrcId": 33295,
"images":[
{
"url":"https://sellercenter.net/5/3ad4b3bf04.jpg",
"hash":"3d077d5a73bdb7e0f1ca1e0ccc6feb2e"
},
{
"url":"https://cdn.shop.com/p/1034-6172-4301-2-catalog.jpg",
"hash":"a8f5f167f44f4964e6c998dee827110c"
},
{
"url":"https://cdn.shop.com/p/a3f20e8a11.jpg",
"hash":"11ad8e84e1ba9b8ff784f524e841966d"
}
]
},
"id":1
}
Request fields:
Field name |
Type |
Example value |
Description |
---|---|---|---|
method |
string |
"Product.updateImageCollections" |
Action name |
productSetSrcId |
int |
33295 |
Endpoint product set id, src_id for the product set |
url |
string |
"https://sellercenter.net/a/a3f20e8a11.jpg" |
A URL to the image file, either hosted on our side or on the shop's side |
hash |
string |
"11ad8e84e1ba9b8ff784f524e841966d" |
Hash for the image content, currently using md5 for this. |
Response
JSON example:
{
"api":1,
"result":{
"productSetSrcId": 33295,
"images":[
{
"uri":"/p/1034-6172-4301-2-catalog.jpg",
"hash":"3d077d5a73bdb7e0f1ca1e0ccc6feb2e",
"srcId": 123
},
{
"uri":"/p/1034-6172-4301-2-catalog.jpg",
"hash":"a8f5f167f44f4964e6c998dee827110c",
"srcId": 124
},
{
"uri":"/p/1034-6172-4301-2-catalog.jpg",
"hash":"11ad8e84e1ba9b8ff784f524e841966d",
"srcId": 124
}
]
},
"id":1
}
Response fields:
Field |
Type |
Value |
Description |
---|---|---|---|
productSetSrcId |
int |
33295 |
The "config" product id, which corresponds to the product set id from SC side |
uri |
string |
"/p/1034-6172-4301-2-catalog.jpg" |
A URI to the image file on the shop's side |
hash |
string |
"11ad8e84e1ba9b8ff784f524e841966d" |
Hash for the image content, currently using md5 for this. Used as an identifier so should correspond to the request. |
srcId |
int |
123 |
Image identifier from shop, the source id. |
It is advised that the original image sent by Seller Center always get saved as well for reference / investigation purposes even when image processing with internal or external tools take place and the original image is no longer used.
The response must contain the same hashes then the request. If not the processing on Seller Center since will fail since we cannot match the images of the response to the request.
Any new hash sent by a subsequent request should be treated as a new image on shop side regardless of the image url. Even an identical image url might consists of a new image which is considered bad practice but might happen due to some legacy system on seller side.