TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TmallNrtItemMainSynchronizeRequest req = new TmallNrtItemMainSynchronizeRequest();
req.setBoothId("1234");
req.setCid(50019997L);
List<TmallNrtItemMainSynchronizeRequest.CategoryPropDto> list2 = new ArrayList<TmallNrtItemMainSynchronizeRequest.CategoryPropDto>();
TmallNrtItemMainSynchronizeRequest.CategoryPropDto obj3 = new TmallNrtItemMainSynchronizeRequest.CategoryPropDto();
list2.add(obj3);
obj3.setPropertyId(20000L);
obj3.setPropertyName("品牌");
obj3.setValueId(1234567L);
obj3.setValueText("测试品牌");
req.setProps(list2);
req.setDealerCode("dealer001");
req.setMallId("1234");
req.setOuterId("123456");
TmallNrtItemMainSynchronizeRequest.MacallineItemExtDto obj4 = new TmallNrtItemMainSynchronizeRequest.MacallineItemExtDto();
obj4.setBrandSeriesId("123A");
obj4.setBrandSeriesName("系列A");
obj4.setChargeUnit("BM");
obj4.setGrade(1L);
obj4.setLabelPriceType(1L);
TmallNrtItemMainSynchronizeRequest.LocationDto obj5 = new TmallNrtItemMainSynchronizeRequest.LocationDto();
obj5.setCity("杭州");
obj5.setCityId(1L);
obj5.setProv("浙江");
obj5.setProvId(1L);
obj5.setType(1L);
obj4.setOriginalLocation(obj5);
obj4.setPriceType(1L);
obj4.setPricer("007");
obj4.setSecondarySteel("测试");
obj4.setSpecification("10");
obj4.setSpecificationUnit("kg");
obj4.setSubstrate("测试");
obj4.setSupportReturnGoods(true);
obj4.setVeneer("饰面");
req.setOuterProps(obj4);
req.setPrice("99.9");
req.setTitle("床");
TmallNrtItemMainSynchronizeResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
TmallNrtItemMainSynchronizeRequest req = new TmallNrtItemMainSynchronizeRequest();
req.BoothId = "1234";
req.Cid = 50019997L;
List<TmallNrtItemMainSynchronizeRequest.CategoryPropDtoDomain> list2 = new List<TmallNrtItemMainSynchronizeRequest.CategoryPropDtoDomain>();
TmallNrtItemMainSynchronizeRequest.CategoryPropDtoDomain obj3 = new TmallNrtItemMainSynchronizeRequest.CategoryPropDtoDomain();
list2.Add(obj3);
obj3.PropertyId = 20000L;
obj3.PropertyName = "品牌";
obj3.ValueId = 1234567L;
obj3.ValueText = "测试品牌";
req.Props_ = list2;
req.DealerCode = "dealer001";
req.MallId = "1234";
req.OuterId = "123456";
TmallNrtItemMainSynchronizeRequest.MacallineItemExtDtoDomain obj4 = new TmallNrtItemMainSynchronizeRequest.MacallineItemExtDtoDomain();
obj4.BrandSeriesId = "123A";
obj4.BrandSeriesName = "系列A";
obj4.ChargeUnit = "BM";
obj4.Grade = 1L;
obj4.LabelPriceType = 1L;
TmallNrtItemMainSynchronizeRequest.LocationDtoDomain obj5 = new TmallNrtItemMainSynchronizeRequest.LocationDtoDomain();
obj5.City = "杭州";
obj5.CityId = 1L;
obj5.Prov = "浙江";
obj5.ProvId = 1L;
obj5.Type = 1L;
obj4.OriginalLocation= obj5;
obj4.PriceType = 1L;
obj4.Pricer = "007";
obj4.SecondarySteel = "测试";
obj4.Specification = "10";
obj4.SpecificationUnit = "kg";
obj4.Substrate = "测试";
obj4.SupportReturnGoods = true;
obj4.Veneer = "饰面";
req.OuterProps_ = obj4;
req.Price = "99.9";
req.Title = "床";
TmallNrtItemMainSynchronizeResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new TmallNrtItemMainSynchronizeRequest;
$req->setBoothId("1234");
$req->setCid("50019997");
$props = new CategoryPropDto;
$props->property_id="20000";
$props->property_name="品牌";
$props->value_id="1234567";
$props->value_text="测试品牌";
$req->setProps(json_encode($props));
$req->setDealerCode("dealer001");
$req->setMallId("1234");
$req->setOuterId("123456");
$outer_props = new MacallineItemExtDto;
$outer_props->brand_series_id="123A";
$outer_props->brand_series_name="系列A";
$outer_props->charge_unit="BM";
$outer_props->grade="1";
$outer_props->label_price_type="1";
$original_location = new LocationDto;
$original_location->city="杭州";
$original_location->city_id="1";
$original_location->prov="浙江";
$original_location->prov_id="1";
$original_location->type="1";
$outer_props->original_location = $original_location;
$outer_props->price_type="1";
$outer_props->pricer="007";
$outer_props->secondary_steel="测试";
$outer_props->specification="10";
$outer_props->specification_unit="kg";
$outer_props->substrate="测试";
$outer_props->support_return_goods="true";
$outer_props->veneer="饰面";
$req->setOuterProps(json_encode($outer_props));
$req->setPrice("99.9");
$req->setTitle("床");
$resp = $c->execute($req, $sessionKey);
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=tmall.nrt.item.main.synchronize' \
-d 'partner_id=apidoc' \
-d 'session=c6e2f9e0-1628-4315-916c-f7c90d2a111f' \
-d 'sign=498AF4A6FA509AEE0F47170469005E49' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-12+13%3A13%3A42' \
-d 'v=2.0' \
-d 'booth_id=1234' \
-d 'cid=50019997' \
-d 'dealer_code=dealer001' \
-d 'mall_id=1234' \
-d 'outer_id=123456' \
-d 'outer_props=null' \
-d 'price=99.9' \
-d 'props=null' \
-d 'title=%E5%BA%8A'
# -*- coding: utf-8 -*-
import top.api
req=top.api.TmallNrtItemMainSynchronizeRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.booth_id="1234"
req.cid=50019997
req.props=""
req.dealer_code="dealer001"
req.mall_id="1234"
req.outer_id="123456"
req.outer_props=""
req.price="99.9"
req.title="床"
try:
resp= req.getResponse(sessionkey)
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,"tmall.nrt.item.main.synchronize");
add_param(pRequest,"booth_id","1234");
add_param(pRequest,"cid","50019997");
add_param(pRequest,"props","数据结构JSON示例");
add_param(pRequest,"dealer_code","dealer001");
add_param(pRequest,"mall_id","1234");
add_param(pRequest,"outer_id","123456");
add_param(pRequest,"outer_props","数据结构JSON示例");
add_param(pRequest,"price","99.9");
add_param(pRequest,"title","床");
pResponse = top_execute(pClient,pRequest,sessionKey);
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('tmall.nrt.item.main.synchronize', {
'booth_id':'1234',
'cid':'50019997',
'props':'数据结构JSON示例',
'dealer_code':'dealer001',
'mall_id':'1234',
'outer_id':'123456',
'outer_props':'数据结构JSON示例',
'price':'99.9',
'title':'床'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})