QimenClient client = new DefaultQimenClient(url, appkey, secret);
ItemsSynchronizeRequest req = new ItemsSynchronizeRequest();
req.setCustomerId("stub-cust-code");
req.setVersion("2.0");
req.setActionType("add");
req.setWarehouseCode("CK1234");
req.setOwnerCode("HZ123");
Item obj1 = new Item();
obj1.setProductCode("奇门仓储字段,说明,string(50),,");
obj1.setPaperQty("奇门仓储字段,说明,string(50),,");
obj1.setDiffQuantity("奇门仓储字段,说明,string(50),,");
obj1.setExtCode("奇门仓储字段,说明,string(50),,");
Batch obj2 = new Batch();
obj2.setBatchCode("奇门仓储字段,说明,string(50),,");
obj2.setProductDate("奇门仓储字段,说明,string(50),,");
obj2.setExpireDate("奇门仓储字段,说明,string(50),,");
obj2.setProduceCode("奇门仓储字段,说明,string(50),,");
obj2.setInventoryType("奇门仓储字段,说明,string(50),,");
obj2.setActualQty("奇门仓储字段,说明,string(50),,");
obj2.setQuantity("奇门仓储字段,说明,string(50),,");
obj1.setBatchs(obj2);
PriceAdjustment obj3 = new PriceAdjustment();
obj3.setType("奇门仓储字段,说明,string(50),,");
obj3.setStandardPrice("奇门仓储字段,说明,string(50),,");
obj3.setDiscount("奇门仓储字段,说明,string(50),,");
obj3.setStartDate("奇门仓储字段,说明,string(50),,");
obj3.setEndDate("奇门仓储字段,说明,string(50),,");
obj1.setPriceAdjustment(obj3);
obj1.setOriginCode("奇门仓储字段,说明,string(50),,");
obj1.setItemCode("I1234");
obj1.setItemId("WI1234");
obj1.setGoodsCode("H1234");
obj1.setItemName("SN123");
obj1.setShortName("JC123");
obj1.setEnglishName("EN123");
obj1.setBarCode("T1;T2");
obj1.setSkuProperty("红色");
obj1.setStockUnit("个");
obj1.setLength("12.0");
obj1.setWidth("12.0");
obj1.setHeight("12.0");
obj1.setVolume("12.0");
obj1.setGrossWeight("12.0");
obj1.setNetWeight("12.0");
obj1.setColor("红色");
obj1.setSize("5英尺");
obj1.setTitle("淘公仔");
obj1.setCategoryId("LB123");
obj1.setCategoryName("手机");
obj1.setPricingCategory("手机类");
obj1.setSafetyStock(12L);
obj1.setItemType("ZC");
obj1.setTagPrice("12.0");
obj1.setRetailPrice("12.0");
obj1.setCostPrice("12.0");
obj1.setPurchasePrice("12.0");
obj1.setSeasonCode("CHUN");
obj1.setSeasonName("春季");
obj1.setBrandCode("LAL");
obj1.setBrandName("HM");
obj1.setIsSNMgmt("N");
obj1.setProductDate("2016-09-09");
obj1.setExpireDate("2016-09-09");
obj1.setIsShelfLifeMgmt("N");
obj1.setShelfLife(1L);
obj1.setRejectLifecycle(1L);
obj1.setLockupLifecycle(1L);
obj1.setAdventLifecycle(1L);
obj1.setIsBatchMgmt("N");
obj1.setBatchCode("P1234");
obj1.setBatchRemark("备注信息");
obj1.setPackCode("B12");
obj1.setPcs("XG123");
obj1.setOriginAddress("HK");
obj1.setApprovalNumber("PB123");
obj1.setIsFragile("N");
obj1.setIsHazardous("N");
obj1.setRemark("备注信息");
obj1.setCreateTime("2017-09-09 12:00:00");
obj1.setUpdateTime("2017-09-09 12:00:00");
obj1.setIsValid("N");
obj1.setIsSku("N");
obj1.setPackageMaterial("BX123");
obj1.setOwnerCode("temp");
obj1.setSupplierCode("temp");
obj1.setSupplierName("temp");
obj1.setSn("temp");
obj1.setTareWeight("temp");
obj1.setStockStatus("temp");
obj1.setPrice("temp");
obj1.setIsAreaSale("temp");
obj1.setQuantity("temp");
obj1.setNormalQty("temp");
obj1.setDefectiveQty("temp");
obj1.setReceiveQty("temp");
obj1.setExCode("temp");
obj1.setDiscountPrice("temp");
obj1.setInventoryType("temp");
obj1.setPlanQty("temp");
obj1.setSourceOrderCode("temp");
obj1.setSubSourceOrderCode("temp");
obj1.setProduceCode("temp");
obj1.setOrderLineNo("temp");
obj1.setActualQty("temp");
obj1.setAmount("temp");
obj1.setUnit("temp");
obj1.setWarehouseCode("temp");
obj1.setLockQuantity("temp");
obj1.setOrderCode("temp");
obj1.setOrderType("temp");
obj1.setOutBizCode("temp");
obj1.setLackQty("temp");
obj1.setReason("temp");
obj1.setSnCode("temp");
obj1.setStandardPrice("temp");
obj1.setReferencePrice("temp");
obj1.setDiscount("temp");
obj1.setActualAmount("temp");
obj1.setLatestUpdateTime("temp");
obj1.setChangeTime("temp");
obj1.setTempRequirement("temp");
obj1.setChannelCode("temp");
obj1.setLogisticsType("1");
obj1.setIsLiquid("N");
req.setItems(obj1);
ItemsSynchronizeResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
IQimenClient client = new DefaultQimenClient(url, appkey, secret);
ItemsSynchronizeRequest req = new ItemsSynchronizeRequest();
req.CustomerId = "stub-cust-code";
req.Version = "2.0";
req.ActionType = "add";
req.WarehouseCode = "CK1234";
req.OwnerCode = "HZ123";
ItemsSynchronizeRequest.ItemDomain obj1 = new ItemsSynchronizeRequest.ItemDomain();
req.Items_= obj1;
obj1.ProductCode = "奇门仓储字段,说明,string(50),,";
obj1.PaperQty = "奇门仓储字段,说明,string(50),,";
obj1.DiffQuantity = "奇门仓储字段,说明,string(50),,";
obj1.ExtCode = "奇门仓储字段,说明,string(50),,";
List<ItemsSynchronizeRequest.BatchDomain> list3 = new List<ItemsSynchronizeRequest.BatchDomain>();
ItemsSynchronizeRequest.BatchDomain obj4 = new ItemsSynchronizeRequest.BatchDomain();
list3.Add(obj4);
obj1.Batchs_ = list3;
obj4.BatchCode = "奇门仓储字段,说明,string(50),,";
obj4.ProductDate = "奇门仓储字段,说明,string(50),,";
obj4.ExpireDate = "奇门仓储字段,说明,string(50),,";
obj4.ProduceCode = "奇门仓储字段,说明,string(50),,";
obj4.InventoryType = "奇门仓储字段,说明,string(50),,";
obj4.ActualQty = "奇门仓储字段,说明,string(50),,";
obj4.Quantity = "奇门仓储字段,说明,string(50),,";
obj1.Batchs= list5;
List<ItemsSynchronizeRequest.PriceAdjustmentDomain> list7 = new List<ItemsSynchronizeRequest.PriceAdjustmentDomain>();
ItemsSynchronizeRequest.PriceAdjustmentDomain obj8 = new ItemsSynchronizeRequest.PriceAdjustmentDomain();
list7.Add(obj8);
obj1.PriceAdjustment_ = list7;
obj8.Type = "奇门仓储字段,说明,string(50),,";
obj8.StandardPrice = "奇门仓储字段,说明,string(50),,";
obj8.Discount = "奇门仓储字段,说明,string(50),,";
obj8.StartDate = "奇门仓储字段,说明,string(50),,";
obj8.EndDate = "奇门仓储字段,说明,string(50),,";
obj1.PriceAdjustment= list9;
obj1.OriginCode = "奇门仓储字段,说明,string(50),,";
obj1.ItemCode = "I1234";
obj1.ItemId = "WI1234";
obj1.GoodsCode = "H1234";
obj1.ItemName = "SN123";
obj1.ShortName = "JC123";
obj1.EnglishName = "EN123";
obj1.BarCode = "T1;T2";
obj1.SkuProperty = "红色";
obj1.StockUnit = "个";
obj1.Length = "12.0";
obj1.Width = "12.0";
obj1.Height = "12.0";
obj1.Volume = "12.0";
obj1.GrossWeight = "12.0";
obj1.NetWeight = "12.0";
obj1.Color = "红色";
obj1.Size = "5英尺";
obj1.Title = "淘公仔";
obj1.CategoryId = "LB123";
obj1.CategoryName = "手机";
obj1.PricingCategory = "手机类";
obj1.SafetyStock = 12L;
obj1.ItemType = "ZC";
obj1.TagPrice = "12.0";
obj1.RetailPrice = "12.0";
obj1.CostPrice = "12.0";
obj1.PurchasePrice = "12.0";
obj1.SeasonCode = "CHUN";
obj1.SeasonName = "春季";
obj1.BrandCode = "LAL";
obj1.BrandName = "HM";
obj1.IsSNMgmt = "N";
obj1.ProductDate = "2016-09-09";
obj1.ExpireDate = "2016-09-09";
obj1.IsShelfLifeMgmt = "N";
obj1.ShelfLife = 1L;
obj1.RejectLifecycle = 1L;
obj1.LockupLifecycle = 1L;
obj1.AdventLifecycle = 1L;
obj1.IsBatchMgmt = "N";
obj1.BatchCode = "P1234";
obj1.BatchRemark = "备注信息";
obj1.PackCode = "B12";
obj1.Pcs = "XG123";
obj1.OriginAddress = "HK";
obj1.ApprovalNumber = "PB123";
obj1.IsFragile = "N";
obj1.IsHazardous = "N";
obj1.Remark = "备注信息";
obj1.CreateTime = "2017-09-09 12:00:00";
obj1.UpdateTime = "2017-09-09 12:00:00";
obj1.IsValid = "N";
obj1.IsSku = "N";
obj1.PackageMaterial = "BX123";
obj1.OwnerCode = "temp";
obj1.SupplierCode = "temp";
obj1.SupplierName = "temp";
obj1.Sn = "temp";
obj1.TareWeight = "temp";
obj1.StockStatus = "temp";
obj1.Price = "temp";
obj1.IsAreaSale = "temp";
obj1.Quantity = "temp";
obj1.NormalQty = "temp";
obj1.DefectiveQty = "temp";
obj1.ReceiveQty = "temp";
obj1.ExCode = "temp";
obj1.DiscountPrice = "temp";
obj1.InventoryType = "temp";
obj1.PlanQty = "temp";
obj1.SourceOrderCode = "temp";
obj1.SubSourceOrderCode = "temp";
obj1.ProduceCode = "temp";
obj1.OrderLineNo = "temp";
obj1.ActualQty = "temp";
obj1.Amount = "temp";
obj1.Unit = "temp";
obj1.WarehouseCode = "temp";
obj1.LockQuantity = "temp";
obj1.OrderCode = "temp";
obj1.OrderType = "temp";
obj1.OutBizCode = "temp";
obj1.LackQty = "temp";
obj1.Reason = "temp";
obj1.SnCode = "temp";
obj1.StandardPrice = "temp";
obj1.ReferencePrice = "temp";
obj1.Discount = "temp";
obj1.ActualAmount = "temp";
obj1.LatestUpdateTime = "temp";
obj1.ChangeTime = "temp";
obj1.TempRequirement = "temp";
obj1.ChannelCode = "temp";
obj1.LogisticsType = "1";
obj1.IsLiquid = "N";
req.Items_ = obj1;
ItemsSynchronizeResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new QimenItemsSynchronizeRequest;
$request = new ItemsSynchronizeRequest;
$request->action_type="add";
$request->warehouse_code="CK1234";
$request->owner_code="HZ123";
$items = new Item;
$items->product_code="奇门仓储字段,说明,string(50),,";
$items->paper_qty="奇门仓储字段,说明,string(50),,";
$items->diff_quantity="奇门仓储字段,说明,string(50),,";
$items->ext_code="奇门仓储字段,说明,string(50),,";
$batchs = new Batch;
$batchs->batch_code="奇门仓储字段,说明,string(50),,";
$batchs->product_date="奇门仓储字段,说明,string(50),,";
$batchs->expire_date="奇门仓储字段,说明,string(50),,";
$batchs->produce_code="奇门仓储字段,说明,string(50),,";
$batchs->inventory_type="奇门仓储字段,说明,string(50),,";
$batchs->actual_qty="奇门仓储字段,说明,string(50),,";
$batchs->quantity="奇门仓储字段,说明,string(50),,";
$items->batchs = $batchs;
$priceAdjustment = new PriceAdjustment;
$priceAdjustment->type="奇门仓储字段,说明,string(50),,";
$priceAdjustment->standard_price="奇门仓储字段,说明,string(50),,";
$priceAdjustment->discount="奇门仓储字段,说明,string(50),,";
$priceAdjustment->start_date="奇门仓储字段,说明,string(50),,";
$priceAdjustment->end_date="奇门仓储字段,说明,string(50),,";
$items->priceAdjustment = $priceAdjustment;
$items->origin_code="奇门仓储字段,说明,string(50),,";
$items->item_code="I1234";
$items->item_id="WI1234";
$items->goods_code="H1234";
$items->item_name="SN123";
$items->short_name="JC123";
$items->english_name="EN123";
$items->bar_code="T1;T2";
$items->sku_property="红色";
$items->stock_unit="个";
$items->length="12.0";
$items->width="12.0";
$items->height="12.0";
$items->volume="12.0";
$items->gross_weight="12.0";
$items->net_weight="12.0";
$items->color="红色";
$items->size="5英尺";
$items->title="淘公仔";
$items->category_id="LB123";
$items->category_name="手机";
$items->pricing_category="手机类";
$items->safety_stock="12";
$items->item_type="ZC";
$items->tag_price="12.0";
$items->retail_price="12.0";
$items->cost_price="12.0";
$items->purchase_price="12.0";
$items->season_code="CHUN";
$items->season_name="春季";
$items->brand_code="LAL";
$items->brand_name="HM";
$items->is_s_n_mgmt="N";
$items->product_date="2016-09-09";
$items->expire_date="2016-09-09";
$items->is_shelf_life_mgmt="N";
$items->shelf_life="1";
$items->reject_lifecycle="1";
$items->lockup_lifecycle="1";
$items->advent_lifecycle="1";
$items->is_batch_mgmt="N";
$items->batch_code="P1234";
$items->batch_remark="备注信息";
$items->pack_code="B12";
$items->pcs="XG123";
$items->origin_address="HK";
$items->approval_number="PB123";
$items->is_fragile="N";
$items->is_hazardous="N";
$items->remark="备注信息";
$items->create_time="2017-09-09 12:00:00";
$items->update_time="2017-09-09 12:00:00";
$items->is_valid="N";
$items->is_sku="N";
$items->package_material="BX123";
$items->owner_code="temp";
$items->supplier_code="temp";
$items->supplier_name="temp";
$items->sn="temp";
$items->tare_weight="temp";
$items->stock_status="temp";
$items->price="temp";
$items->is_area_sale="temp";
$items->quantity="temp";
$items->normal_qty="temp";
$items->defective_qty="temp";
$items->receive_qty="temp";
$items->ex_code="temp";
$items->discount_price="temp";
$items->inventory_type="temp";
$items->plan_qty="temp";
$items->source_order_code="temp";
$items->sub_source_order_code="temp";
$items->produce_code="temp";
$items->order_line_no="temp";
$items->actual_qty="temp";
$items->amount="temp";
$items->unit="temp";
$items->warehouse_code="temp";
$items->lock_quantity="temp";
$items->order_code="temp";
$items->order_type="temp";
$items->out_biz_code="temp";
$items->lack_qty="temp";
$items->reason="temp";
$items->sn_code="temp";
$items->standard_price="temp";
$items->reference_price="temp";
$items->discount="temp";
$items->actual_amount="temp";
$items->latest_update_time="temp";
$items->change_time="temp";
$items->temp_requirement="temp";
$items->channel_code="temp";
$items->logistics_type="1";
$items->is_liquid="N";
$request->items = $items;
$request->extend_props="";
$req->setRequest(json_encode($request));
$resp = $c->execute($req);
curl -X POST 'http://qimenapi.tbsandbox.com/router/qimen/service?app_key=testerp_appkey&customerId=stub-cust-code&format=xml&method=taobao.qimen.items.synchronize&sign=33C336A61BC0FD67BBFF77647C376B99&sign_method=md5×tamp=2025-04-28+18%3A17%3A46&v=2.0&version=1' \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
--data \
'<request>
<actionType>add</actionType>
<ownerCode>HZ123</ownerCode>
<items>
<orderType>temp</orderType>
<reason>temp</reason>
<originAddress>HK</originAddress>
<discount>temp</discount>
<pricingCategory>手机类</pricingCategory>
<itemName>SN123</itemName>
<packCode>B12</packCode>
<price>temp</price>
<height>12.0</height>
<brandCode>LAL</brandCode>
<safetyStock>12</safetyStock>
<seasonCode>CHUN</seasonCode>
<paperQty>奇门仓储字段,说明,string(50),,</paperQty>
<productDate>2016-09-09</productDate>
<stockUnit>个</stockUnit>
<itemId>WI1234</itemId>
<size>5英尺</size>
<rejectLifecycle>1</rejectLifecycle>
<shortName>JC123</shortName>
<planQty>temp</planQty>
<ownerCode>temp</ownerCode>
<diffQuantity>奇门仓储字段,说明,string(50),,</diffQuantity>
<supplierCode>temp</supplierCode>
<defectiveQty>temp</defectiveQty>
<tempRequirement>temp</tempRequirement>
<skuProperty>红色</skuProperty>
<referencePrice>temp</referencePrice>
<exCode>temp</exCode>
<normalQty>temp</normalQty>
<seasonName>春季</seasonName>
<packageMaterial>BX123</packageMaterial>
<expireDate>2016-09-09</expireDate>
<sn>temp</sn>
<shelfLife>1</shelfLife>
<orderLineNo>temp</orderLineNo>
<isValid>N</isValid>
<actualAmount>temp</actualAmount>
<latestUpdateTime>temp</latestUpdateTime>
<costPrice>12.0</costPrice>
<updateTime>2017-09-09 12:00:00</updateTime>
<tagPrice>12.0</tagPrice>
<isSku>N</isSku>
<changeTime>temp</changeTime>
<productCode>奇门仓储字段,说明,string(50),,</productCode>
<isLiquid>N</isLiquid>
<createTime>2017-09-09 12:00:00</createTime>
<width>12.0</width>
<goodsCode>H1234</goodsCode>
<retailPrice>12.0</retailPrice>
<tareWeight>temp</tareWeight>
<priceAdjustment>
<endDate>奇门仓储字段,说明,string(50),,</endDate>
<discount>奇门仓储字段,说明,string(50),,</discount>
<standardPrice>奇门仓储字段,说明,string(50),,</standardPrice>
<type>奇门仓储字段,说明,string(50),,</type>
<startDate>奇门仓储字段,说明,string(50),,</startDate>
</priceAdjustment>
<snCode>temp</snCode>
<itemCode>I1234</itemCode>
<lockQuantity>temp</lockQuantity>
<purchasePrice>12.0</purchasePrice>
<lackQty>temp</lackQty>
<stockStatus>temp</stockStatus>
<originCode>奇门仓储字段,说明,string(50),,</originCode>
<brandName>HM</brandName>
<inventoryType>temp</inventoryType>
<receiveQty>temp</receiveQty>
<barCode>T1;T2</barCode>
<volume>12.0</volume>
<batchs>
<produceCode>奇门仓储字段,说明,string(50),,</produceCode>
<inventoryType>奇门仓储字段,说明,string(50),,</inventoryType>
<quantity>奇门仓储字段,说明,string(50),,</quantity>
<batchCode>奇门仓储字段,说明,string(50),,</batchCode>
<expireDate>奇门仓储字段,说明,string(50),,</expireDate>
<productDate>奇门仓储字段,说明,string(50),,</productDate>
<actualQty>奇门仓储字段,说明,string(50),,</actualQty>
</batchs>
<netWeight>12.0</netWeight>
<unit>temp</unit>
<extCode>奇门仓储字段,说明,string(50),,</extCode>
<sourceOrderCode>temp</sourceOrderCode>
<isSNMgmt>N</isSNMgmt>
<lockupLifecycle>1</lockupLifecycle>
<englishName>EN123</englishName>
<itemType>ZC</itemType>
<color>红色</color>
<adventLifecycle>1</adventLifecycle>
<discountPrice>temp</discountPrice>
<remark>备注信息</remark>
<title>淘公仔</title>
<categoryName>手机</categoryName>
<actualQty>temp</actualQty>
<warehouseCode>temp</warehouseCode>
<produceCode>temp</produceCode>
<isShelfLifeMgmt>N</isShelfLifeMgmt>
<isAreaSale>temp</isAreaSale>
<isFragile>N</isFragile>
<channelCode>temp</channelCode>
<supplierName>temp</supplierName>
<pcs>XG123</pcs>
<isHazardous>N</isHazardous>
<amount>temp</amount>
<quantity>temp</quantity>
<batchCode>P1234</batchCode>
<length>12.0</length>
<standardPrice>temp</standardPrice>
<subSourceOrderCode>temp</subSourceOrderCode>
<approvalNumber>PB123</approvalNumber>
<grossWeight>12.0</grossWeight>
<isBatchMgmt>N</isBatchMgmt>
<batchRemark>备注信息</batchRemark>
<outBizCode>temp</outBizCode>
<orderCode>temp</orderCode>
<logisticsType>1</logisticsType>
<categoryId>LB123</categoryId>
</items>
<warehouseCode>CK1234</warehouseCode>
</request>'
# -*- coding: utf-8 -*-
import top.api
req=top.api.QimenItemsSynchronizeRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.request="数据结构示例JSON格式"
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,"taobao.qimen.items.synchronize");
add_param(pRequest,"request","数据结构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('taobao.qimen.items.synchronize', {
'request':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})