TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaGscOpenapiSharkPriceSaveRequest req = new AlibabaGscOpenapiSharkPriceSaveRequest();
AlibabaGscOpenapiSharkPriceSaveRequest.CostRequest obj1 = new AlibabaGscOpenapiSharkPriceSaveRequest.CostRequest();
List<AlibabaGscOpenapiSharkPriceSaveRequest.StockCostItem> list3 = new ArrayList<AlibabaGscOpenapiSharkPriceSaveRequest.StockCostItem>();
AlibabaGscOpenapiSharkPriceSaveRequest.StockCostItem obj4 = new AlibabaGscOpenapiSharkPriceSaveRequest.StockCostItem();
list3.add(obj4);
obj4.setItemCode("1xeeww");
obj4.setMaterialDocNum("1212");
obj4.setMaterialDocYear("121212");
obj4.setPrice("0.01");
obj4.setGuId("1");
obj1.setItemList(list3);
obj1.setKey("1");
obj1.setTenant("gsc202");
req.setCostRequest(obj1);
AlibabaGscOpenapiSharkPriceSaveResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaGscOpenapiSharkPriceSaveRequest req = new AlibabaGscOpenapiSharkPriceSaveRequest();
AlibabaGscOpenapiSharkPriceSaveRequest.CostRequestDomain obj1 = new AlibabaGscOpenapiSharkPriceSaveRequest.CostRequestDomain();
List<AlibabaGscOpenapiSharkPriceSaveRequest.StockCostItemDomain> list3 = new List<AlibabaGscOpenapiSharkPriceSaveRequest.StockCostItemDomain>();
AlibabaGscOpenapiSharkPriceSaveRequest.StockCostItemDomain obj4 = new AlibabaGscOpenapiSharkPriceSaveRequest.StockCostItemDomain();
list3.Add(obj4);
obj4.ItemCode = "1xeeww";
obj4.MaterialDocNum = "1212";
obj4.MaterialDocYear = "121212";
obj4.Price = "0.01";
obj4.GuId = "1";
obj1.ItemList= list3;
obj1.Key = "1";
obj1.Tenant = "gsc202";
req.CostRequest_ = obj1;
AlibabaGscOpenapiSharkPriceSaveResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaGscOpenapiSharkPriceSaveRequest;
$cost_request = new CostRequest;
$item_list = new StockCostItem;
$item_list->item_code="1xeeww";
$item_list->material_doc_num="1212";
$item_list->material_doc_year="121212";
$item_list->price="0.01";
$item_list->gu_id="1";
$cost_request->item_list = $item_list;
$cost_request->key="1";
$cost_request->tenant="gsc202";
$req->setCostRequest(json_encode($cost_request));
$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.openapi.shark.price.save' \
-d 'partner_id=apidoc' \
-d 'sign=25C4CCCB2B484BDD5DB34CAFF503E361' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-27+23%3A17%3A46' \
-d 'v=2.0' \
-d 'cost_request=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaGscOpenapiSharkPriceSaveRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.cost_request=""
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.openapi.shark.price.save");
add_param(pRequest,"cost_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('alibaba.gsc.openapi.shark.price.save', {
'cost_request':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})