QimenClient client = new DefaultQimenClient(url, appkey, secret);
InventoryruleCreateRequest req = new InventoryruleCreateRequest();
req.setCustomerId("stub-cust-code");
req.setVersion("2.0");
req.setOwnerCode("奇门仓储字段,C1223,string(50),,");
InventoryRule obj1 = new InventoryRule();
obj1.setActionType("奇门仓储字段,C1223,string(50),,");
obj1.setItemCode("奇门仓储字段,C1223,string(50),,");
ChannelRatioRule obj2 = new ChannelRatioRule();
obj2.setChannelCode("奇门仓储字段,C1223,string(50),,");
obj2.setRatio("奇门仓储字段,C1223,string(50),,");
obj1.setChannelRatioRules(obj2);
req.setInventoryRules(obj1);
InventoryruleCreateResponse rsp = client.execute(req);
System.out.println(rsp.getBody());
IQimenClient client = new DefaultQimenClient(url, appkey, secret);
InventoryruleCreateRequest req = new InventoryruleCreateRequest();
req.CustomerId = "stub-cust-code";
req.Version = "2.0";
req.OwnerCode = "奇门仓储字段,C1223,string(50),,";
InventoryruleCreateRequest.InventoryRuleDomain obj1 = new InventoryruleCreateRequest.InventoryRuleDomain();
req.InventoryRules_= obj1;
obj1.ActionType = "奇门仓储字段,C1223,string(50),,";
obj1.ItemCode = "奇门仓储字段,C1223,string(50),,";
List<InventoryruleCreateRequest.ChannelRatioRuleDomain> list3 = new List<InventoryruleCreateRequest.ChannelRatioRuleDomain>();
InventoryruleCreateRequest.ChannelRatioRuleDomain obj4 = new InventoryruleCreateRequest.ChannelRatioRuleDomain();
list3.Add(obj4);
obj1.ChannelRatioRules_ = list3;
obj4.ChannelCode = "奇门仓储字段,C1223,string(50),,";
obj4.Ratio = "奇门仓储字段,C1223,string(50),,";
obj1.ChannelRatioRules= list5;
req.InventoryRules_ = obj1;
InventoryruleCreateResponse rsp = client.Execute(req);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new QimenInventoryruleCreateRequest;
$request = new RequestDO;
$request->owner_code="奇门仓储字段,C1223,string(50),,";
$inventoryRules = new InventoryRule;
$inventoryRules->action_type="奇门仓储字段,C1223,string(50),,";
$inventoryRules->item_code="奇门仓储字段,C1223,string(50),,";
$channelRatioRules = new ChannelRatioRule;
$channelRatioRules->channel_code="奇门仓储字段,C1223,string(50),,";
$channelRatioRules->ratio="奇门仓储字段,C1223,string(50),,";
$inventoryRules->channelRatioRules = $channelRatioRules;
$request->inventoryRules = $inventoryRules;
$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.inventoryrule.create&sign=77999D0BF94B795EA5E2861E4034BC8C&sign_method=md5×tamp=2025-04-28+18%3A23%3A34&v=2.0&version=1' \
-H 'Content-Type:application/x-www-form-urlencoded;charset=utf-8' \
--data \
'<request>
<inventoryRules>
<actionType>奇门仓储字段,C1223,string(50),,</actionType>
<itemCode>奇门仓储字段,C1223,string(50),,</itemCode>
<channelRatioRules>
<channelCode>奇门仓储字段,C1223,string(50),,</channelCode>
<ratio>奇门仓储字段,C1223,string(50),,</ratio>
</channelRatioRules>
</inventoryRules>
<ownerCode>奇门仓储字段,C1223,string(50),,</ownerCode>
</request>'
# -*- coding: utf-8 -*-
import top.api
req=top.api.QimenInventoryruleCreateRequest(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.inventoryrule.create");
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.inventoryrule.create', {
'request':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})