Product.updateProducts
Updates product based on the passed productData data. All the specification of the ProductDataStructure can be set to update the product. Additionally a productId is required for the data set where the update will happen.
Request
JSON example:
[
{
"api":1,
"method":"auth",
"params":{
"username":"...",
"password":"..."
},
"id":1
},
{
"api":1,
"method":"Product.updateProducts",
"params":{
"productsInfo":[
{
"product_id":"450299",
"seller_sku":"6252-beige-36",
"sku":"JC613FAAFKR8NAFAMZ-450299",
"status":"active",
"product_identifier":null,
"title":"Leather Wedges - Beige",
"brand":"5613",
"attribute_set":"7",
"shipment_type":"2",
"description":"Description",
"price":"145.00",
"special_price":null,
"special_from_date":null,
"special_to_date":null,
"tax_class":"1",
"approval_status":1,
"primary_category": "1125",
"categories":[
"2309",
"1125",
"353",
"320",
"490",
"1"
],
"attributes":{
"4":"active",
"27":"6252",
"28":"7",
"29":"11",
"30":"46",
"50":"0.846615385",
"55":"J.C Consignment Marketplace",
"64":"6",
"66":"10",
"68":"1",
"70":"2",
"71":"4",
"77":"Beige",
"78":[
"6"
],
"80":"Leather"
},
"product_set":"83291",
"id_catalog_product":"174301",
"config_id":"260180",
"shipment_matrix_template":[
],
"rsin":"ABCD12345678"
}
]
},
"id":1
}
]
Request fields:
Field name |
Type |
Example value |
Description |
---|---|---|---|
method |
string |
"Product.updateProducts" |
Action name |
product_id |
string |
"6069" |
Endpoint product id |
seller_sku |
string |
"POL8100S" |
Seller given SKU |
sku |
string |
"RB635FAAA2VJNAFAMZ-6069" |
Product SKU |
status |
string |
"active" |
|
product_identifier |
string |
"identifier 1" |
Optional is set if product identifier field available |
title |
string |
"Title" |
undefined |
brand |
string |
"123" |
Brand id |
attribute_set |
string |
"7" |
Id of the product attribute set |
shipment_type |
string |
"2" |
|
description |
string |
"Product Description" |
undefined |
price |
string |
"3500.00" |
Price that customer has to pay |
special_price |
string | null |
"179.00" |
Special price during the period |
specialfromdate |
string | null |
"2013-12-23 00:00:00" |
Date since when special price is valid |
specialtodate |
string | null |
"2013-12-23 00:00:00" |
Date since when special price is not valid |
tax_class |
string |
"1" |
Endpoint system tax class identifier (catalogtaxclass.src_id) |
approval_status |
integer |
1 |
|
primary_category |
string |
"212" |
Primary Category of the product |
categories |
array |
["10", "20", …] |
Ids of categories product is assigned to |
attributes |
array |
[] |
Key/Value array of attributes, depending on the attribute set, without primary attributes/properties that have their own entries (ie: brand, title, etc) |
product_set |
string |
"89798" |
SC product set id |
config_id |
string |
"18674" |
Endpoint product set id |
shipmentmatrixtemplate |
array |
["1", "2", …] |
Optional Ids of the product shipping matrix templates |
country_city |
string |
"984731284" |
Optional is set if product has Country/City configuration |
group_name |
string |
"Group 1" |
Optional is set if product groups feature is enabled |
rsin |
string |
"ABCD12345678" |
RSIN assigned to the product by the deduplication service |
idcatalogproduct |
string |
"12348" |
Is the identifier of a product in Seller Center |
Within updateProducts call SC performs several data change requests:
- updates whole product information;
- updates product status;
- updates stock (executed only when endpoint does not support Product.updateStock call);
- updates prices;
- updates content
Depending on the purpose of the request, some fields are skipped. The table above displays all the fields, which are submitted during the whole product information update. Other purpose requests submits the following fields:
Field name |
Update Approval Status* |
Update Stock |
Update Price |
Update Content |
---|---|---|---|---|
product_id |
+ |
+ |
+ |
+ |
sku |
+ |
+ |
+ |
+ |
status |
+ |
undefined | undefined | + |
approval_status |
+ |
undefined | undefined | + |
config_id |
+ |
undefined | + |
+ |
attribute_set |
+ |
undefined | + |
+ |
stock |
undefined | + |
undefined | |
seller_sku |
+ |
+ |
+ |
+ |
price |
undefined | undefined | + |
undefined |
special_price |
undefined | undefined | + |
undefined |
specialfromdate |
undefined | undefined | + |
undefined |
specialtodate |
undefined | undefined | + |
undefined |
product_identifier |
undefined | undefined | undefined | + |
title |
undefined | undefined | undefined | + |
brand |
undefined | undefined | undefined | + |
shipment_type |
undefined | undefined | undefined | + |
description |
undefined | undefined | undefined | + |
tax_class |
undefined | undefined | undefined | + |
primary_category |
undefined | undefined | undefined | + |
categories |
undefined | undefined | undefined | + |
attributes |
undefined | undefined | undefined | + |
product_set |
undefined | undefined | undefined | + |
shipmentmatrixtemplate |
undefined | undefined | undefined | + |
country_city |
undefined | undefined | undefined | + |
group_name |
undefined | undefined | undefined | + |
rsin |
undefined | undefined | undefined | + |
idcatalogproduct |
undefined | undefined | undefined | + |
* Seller Center will send a notification to the Shop when the approval status is changed to "not-approved" but only if the setting: "Send QC Status to Shop when price is pending/approved in QC" is enabled inside Administration > Settings > Settings > product Management. The role of this call is to allow the Shop to put offline a product for which the price was changed until the product change is approved in QC (to avoid for example selling products with a wrong price). When the product gets approved in QC the Shop will be notified that the QC status changed to "approved" with an "Update Content" call.
Don't assume wrong defaults!
If a field is not sent, you either throw an error with a descriptive message or you completely ignore it.
For example, you shouldn't reset product price to 0 if the field was not sent.
Response
JSON example:
[
{
"api":1,
"result":[
{
"status":"success",
"product":{
"seller_sku":"POL7100S",
"id":"6069",
"sku":"RB635FAAA2VJ-6069",
"config_id":"3727",
"updated_at":"2015-07-15 10:16:09"
}
},
{
"status":"failure",
"error":{
"message":"No seller sku specified",
"code":0
}
}
],
"id":1
}
]
Response fields:
status |
string |
"success" |
Update status:
|
message |
string |
"No seller sku specified" |
Optional must be set in case of failure. Gives details about the error. |
code |
integer |
123 |
Optional must be set in case of failure. Error code, depending on the remote system. |
seller_sku |
string |
"POL7100S" |
Seller given SKU |
id |
string |
"6069" |
Endpoint product id |
sku |
string |
"RB635FAAA2VJ-6069" |
Product SKU |
config_id |
string |
"3727" |
Endpoint product set id |
updated_at |
string |
"2015-07-15 10:16:09" |
Time when the price was updated |