TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
CainiaoCntecSupplierItemSavesubitemRequest req = new CainiaoCntecSupplierItemSavesubitemRequest();
CainiaoCntecSupplierItemSavesubitemRequest.SubItemSyncDto obj1 = new CainiaoCntecSupplierItemSavesubitemRequest.SubItemSyncDto();
obj1.setSupplierCode("DRF");
obj1.setOutItemId("123123");
obj1.setOutStoreId("1001");
obj1.setSupplierStatus("0");
obj1.setSupplierPrice(1100L);
obj1.setPromotePrice(1200L);
obj1.setFirstProductionArea("中国");
obj1.setSecondProductionArea("黑龙江");
obj1.setFeature("{\"product_item\":\"商品名称\",\"product_quantity\":\"商品数量\"}");
obj1.setModifiedTime(1619682070L);
req.setSubItemSync(obj1);
CainiaoCntecSupplierItemSavesubitemResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
CainiaoCntecSupplierItemSavesubitemRequest req = new CainiaoCntecSupplierItemSavesubitemRequest();
CainiaoCntecSupplierItemSavesubitemRequest.SubItemSyncDtoDomain obj1 = new CainiaoCntecSupplierItemSavesubitemRequest.SubItemSyncDtoDomain();
obj1.SupplierCode = "DRF";
obj1.OutItemId = "123123";
obj1.OutStoreId = "1001";
obj1.SupplierStatus = "0";
obj1.SupplierPrice = 1100L;
obj1.PromotePrice = 1200L;
obj1.FirstProductionArea = "中国";
obj1.SecondProductionArea = "黑龙江";
obj1.Feature = "{\"product_item\":\"商品名称\",\"product_quantity\":\"商品数量\"}";
obj1.ModifiedTime = 1619682070L;
req.SubItemSync_ = obj1;
CainiaoCntecSupplierItemSavesubitemResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new CainiaoCntecSupplierItemSavesubitemRequest;
$sub_item_sync = new SubItemSyncDto;
$sub_item_sync->supplier_code="DRF";
$sub_item_sync->out_item_id="123123";
$sub_item_sync->out_store_id="1001";
$sub_item_sync->supplier_status="0";
$sub_item_sync->supplier_price="1100";
$sub_item_sync->promote_price="1200";
$sub_item_sync->first_production_area="中国";
$sub_item_sync->second_production_area="黑龙江";
$sub_item_sync->feature="{\"product_item\":\"商品名称\",\"product_quantity\":\"商品数量\"}";
$sub_item_sync->modified_time="1619682070";
$req->setSubItemSync(json_encode($sub_item_sync));
$resp = $c->execute($req);
curl -X POST 'http://gw.api.taobao.com/router/rest' \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
-d 'app_key=12129701' \
-d 'format=json' \
-d 'method=cainiao.cntec.supplier.item.savesubitem' \
-d 'partner_id=apidoc' \
-d 'sign=8426AE86D6A14A7F180683B7881AA1EB' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-28+17%3A44%3A13' \
-d 'v=2.0' \
-d 'sub_item_sync=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.CainiaoCntecSupplierItemSavesubitemRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.sub_item_sync=""
try:
resp= req.getResponse()
print(resp)
except Exception,e:
print(e)
pTopRequest pRequest = alloc_top_request();
pTopResponse pResponse = NULL;
pTaobaoClient pClient = alloc_taobao_client(url, appkey, appsecret);
set_api_name(pRequest,"cainiao.cntec.supplier.item.savesubitem");
add_param(pRequest,"sub_item_sync","数据结构JSON示例");
pResponse = top_execute(pClient,pRequest,NULL);
printf("ret code:%d\n",pResponse->code);
if(pResponse->code == 0){
pTopResponseIterator ite = init_response_iterator(pResponse);
pResultItem pResultItem = alloc_result_item();
while(parseNext(ite, pResultItem) == 0){
printf("%s:%s\n",pResultItem->key,pResultItem->value);
}
destroy_response_iterator(ite);
destroy_result_item(pResultItem);
}
destroy_top_request(pRequest);
destroy_top_response(pResponse);
destroy_taobao_client(pClient);
TopClient = require('./topClient').TopClient;
var client = new TopClient({
'appkey': 'appkey',
'appsecret': 'secret',
'REST_URL': 'http://gw.api.taobao.com/router/rest'
});
client.execute('cainiao.cntec.supplier.item.savesubitem', {
'sub_item_sync':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})