TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaMosGoodsSynchinventorybycountingRequest req = new AlibabaMosGoodsSynchinventorybycountingRequest();
AlibabaMosGoodsSynchinventorybycountingRequest.CountingInfoDto obj1 = new AlibabaMosGoodsSynchinventorybycountingRequest.CountingInfoDto();
obj1.setCounterId("2504058");
obj1.setOutCounterId("23112312");
obj1.setRemarks("库存盘点记录");
req.setParamCountingInfoDto(obj1);
List<AlibabaMosGoodsSynchinventorybycountingRequest.CountingItemDto> list3 = new ArrayList<AlibabaMosGoodsSynchinventorybycountingRequest.CountingItemDto>();
AlibabaMosGoodsSynchinventorybycountingRequest.CountingItemDto obj4 = new AlibabaMosGoodsSynchinventorybycountingRequest.CountingItemDto();
list3.add(obj4);
obj4.setOutId("43534233");
obj4.setProductName("运动上衣");
obj4.setQuantity("4");
obj4.setUnit("件");
req.setCountingItemDto(list3);
AlibabaMosGoodsSynchinventorybycountingResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaMosGoodsSynchinventorybycountingRequest req = new AlibabaMosGoodsSynchinventorybycountingRequest();
AlibabaMosGoodsSynchinventorybycountingRequest.CountingInfoDtoDomain obj1 = new AlibabaMosGoodsSynchinventorybycountingRequest.CountingInfoDtoDomain();
obj1.CounterId = "2504058";
obj1.OutCounterId = "23112312";
obj1.Remarks = "库存盘点记录";
req.ParamCountingInfoDto_ = obj1;
List<AlibabaMosGoodsSynchinventorybycountingRequest.CountingItemDtoDomain> list3 = new List<AlibabaMosGoodsSynchinventorybycountingRequest.CountingItemDtoDomain>();
AlibabaMosGoodsSynchinventorybycountingRequest.CountingItemDtoDomain obj4 = new AlibabaMosGoodsSynchinventorybycountingRequest.CountingItemDtoDomain();
list3.Add(obj4);
obj4.OutId = "43534233";
obj4.ProductName = "运动上衣";
obj4.Quantity = "4";
obj4.Unit = "件";
req.CountingItemDto_ = list3;
AlibabaMosGoodsSynchinventorybycountingResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaMosGoodsSynchinventorybycountingRequest;
$param_counting_info_dto = new CountingInfoDto;
$param_counting_info_dto->counter_id="2504058";
$param_counting_info_dto->out_counter_id="23112312";
$param_counting_info_dto->remarks="库存盘点记录";
$req->setParamCountingInfoDto(json_encode($param_counting_info_dto));
$counting_item_dto = new CountingItemDto;
$counting_item_dto->out_id="43534233";
$counting_item_dto->product_name="运动上衣";
$counting_item_dto->quantity="4";
$counting_item_dto->unit="件";
$req->setCountingItemDto(json_encode($counting_item_dto));
$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=alibaba.mos.goods.synchinventorybycounting' \
-d 'partner_id=apidoc' \
-d 'session=a6617b6d-96b7-4dbc-b551-89b1e87af6cc' \
-d 'sign=6E961DDB3F50C99EDDC9B9A880A50FE2' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-05-23+01%3A23%3A09' \
-d 'v=2.0' \
-d 'counting_item_dto=null' \
-d 'param_counting_info_dto=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaMosGoodsSynchinventorybycountingRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.param_counting_info_dto=""
req.counting_item_dto="[]"
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,"alibaba.mos.goods.synchinventorybycounting");
add_param(pRequest,"param_counting_info_dto","数据结构JSON示例");
add_param(pRequest,"counting_item_dto","数据结构JSON示例");
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('alibaba.mos.goods.synchinventorybycounting', {
'param_counting_info_dto':'数据结构JSON示例',
'counting_item_dto':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})