TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaGscInventoryCostpriceSyncRequest req = new AlibabaGscInventoryCostpriceSyncRequest();
AlibabaGscInventoryCostpriceSyncRequest.InventoryMaterialCostPriceSyncDTO obj1 = new AlibabaGscInventoryCostpriceSyncRequest.InventoryMaterialCostPriceSyncDTO();
List<AlibabaGscInventoryCostpriceSyncRequest.InventoryMaterialCostPriceDTO> list3 = new ArrayList<AlibabaGscInventoryCostpriceSyncRequest.InventoryMaterialCostPriceDTO>();
AlibabaGscInventoryCostpriceSyncRequest.InventoryMaterialCostPriceDTO obj4 = new AlibabaGscInventoryCostpriceSyncRequest.InventoryMaterialCostPriceDTO();
list3.add(obj4);
obj4.setCurrencyType("CNY");
obj4.setItemName("天猫精灵红色");
obj4.setOu("8000");
obj4.setItemCode("1X100983H");
obj4.setCostPurchasePrice("12.34");
obj1.setInventoryMaterialCostPriceList(list3);
obj1.setClient("gsc800");
req.setInventoryMaterialCostPriceSyncDto(obj1);
AlibabaGscInventoryCostpriceSyncResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaGscInventoryCostpriceSyncRequest req = new AlibabaGscInventoryCostpriceSyncRequest();
AlibabaGscInventoryCostpriceSyncRequest.InventoryMaterialCostPriceSyncDTODomain obj1 = new AlibabaGscInventoryCostpriceSyncRequest.InventoryMaterialCostPriceSyncDTODomain();
List<AlibabaGscInventoryCostpriceSyncRequest.InventoryMaterialCostPriceDTODomain> list3 = new List<AlibabaGscInventoryCostpriceSyncRequest.InventoryMaterialCostPriceDTODomain>();
AlibabaGscInventoryCostpriceSyncRequest.InventoryMaterialCostPriceDTODomain obj4 = new AlibabaGscInventoryCostpriceSyncRequest.InventoryMaterialCostPriceDTODomain();
list3.Add(obj4);
obj4.CurrencyType = "CNY";
obj4.ItemName = "天猫精灵红色";
obj4.Ou = "8000";
obj4.ItemCode = "1X100983H";
obj4.CostPurchasePrice = "12.34";
obj1.InventoryMaterialCostPriceList= list3;
obj1.Client = "gsc800";
req.InventoryMaterialCostPriceSyncDto_ = obj1;
AlibabaGscInventoryCostpriceSyncResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaGscInventoryCostpriceSyncRequest;
$inventory_material_cost_price_sync_dto = new InventoryMaterialCostPriceSyncDTO;
$inventory_material_cost_price_list = new InventoryMaterialCostPriceDTO;
$inventory_material_cost_price_list->currency_type="CNY";
$inventory_material_cost_price_list->item_name="天猫精灵红色";
$inventory_material_cost_price_list->ou="8000";
$inventory_material_cost_price_list->item_code="1X100983H";
$inventory_material_cost_price_list->cost_purchase_price="12.34";
$inventory_material_cost_price_sync_dto->inventory_material_cost_price_list = $inventory_material_cost_price_list;
$inventory_material_cost_price_sync_dto->client="gsc800";
$req->setInventoryMaterialCostPriceSyncDto(json_encode($inventory_material_cost_price_sync_dto));
$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=alibaba.gsc.inventory.costprice.sync' \
-d 'partner_id=apidoc' \
-d 'sign=944E2F2AEC10074A9D654B792A9C5D7C' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-27+23%3A15%3A04' \
-d 'v=2.0' \
-d 'inventory_material_cost_price_sync_dto=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaGscInventoryCostpriceSyncRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.inventory_material_cost_price_sync_dto="数据结构示例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,"alibaba.gsc.inventory.costprice.sync");
add_param(pRequest,"inventory_material_cost_price_sync_dto","数据结构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('alibaba.gsc.inventory.costprice.sync', {
'inventory_material_cost_price_sync_dto':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})