TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest req = new AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest();
req.setOutOrderId("123456");
req.setBizType("INSTANT_ONLINE");
req.setTid(3315117313009520746L);
AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.SenderTopDTO obj1 = new AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.SenderTopDTO();
obj1.setName("测试发货人");
obj1.setPhone("15616161616");
obj1.setAddress("测试收地址");
obj1.setLat("30.280072");
obj1.setLng("120.026851");
req.setSender(obj1);
AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.ReceiverTopDTO obj2 = new AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.ReceiverTopDTO();
obj2.setName("测试收货人");
obj2.setPhone("15818181818");
obj2.setAddress("测试收货地址");
obj2.setLat("30.275962");
obj2.setLng("120.027276");
req.setReceiver(obj2);
List<AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.ReceiverTopDTO> list4 = new ArrayList<AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.ReceiverTopDTO>();
AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.ReceiverTopDTO obj5 = new AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.ReceiverTopDTO();
list4.add(obj5);
obj5.setItemName("测试商品");
obj5.setItemValue(100L);
obj5.setItemQuantity(1L);
obj5.setItemId(705239667995L);
req.setItemList(list4);
req.setTotalItemValue(1000L);
req.setTotalItemActualValue(1000L);
req.setTotalWeight(20L);
req.setDefaultTradeReceiver(true);
AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.SelectedResourceTopDTO obj6 = new AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.SelectedResourceTopDTO();
obj6.setResourceRequestId("-");
obj6.setResourceCode("TMYP_fnlm_fengka");
obj6.setActualFee(10000L);
req.setSelectedResource(obj6);
req.setPickupCode("41234");
req.setDefaultGenPickupCode(true);
AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.GenPickupCodeConfigTopDTO obj7 = new AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.GenPickupCodeConfigTopDTO();
obj7.setGroup("A001");
req.setGenPickupCodeConfig(obj7);
AlibabaAscpLogisticsInstantsonlineCalldeliveryResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest req = new AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest();
req.OutOrderId = "123456";
req.BizType = "INSTANT_ONLINE";
req.Tid = 3315117313009520746L;
AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.SenderTopDTODomain obj1 = new AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.SenderTopDTODomain();
obj1.Name = "测试发货人";
obj1.Phone = "15616161616";
obj1.Address = "测试收地址";
obj1.Lat = "30.280072";
obj1.Lng = "120.026851";
req.Sender_ = obj1;
AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.ReceiverTopDTODomain obj2 = new AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.ReceiverTopDTODomain();
obj2.Name = "测试收货人";
obj2.Phone = "15818181818";
obj2.Address = "测试收货地址";
obj2.Lat = "30.275962";
obj2.Lng = "120.027276";
req.Receiver_ = obj2;
List<AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.ReceiverTopDTODomain> list4 = new List<AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.ReceiverTopDTODomain>();
AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.ReceiverTopDTODomain obj5 = new AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.ReceiverTopDTODomain();
list4.Add(obj5);
obj5.ItemName = "测试商品";
obj5.ItemValue = 100L;
obj5.ItemQuantity = 1L;
obj5.ItemId = 705239667995L;
req.ItemList_ = list4;
req.TotalItemValue = 1000L;
req.TotalItemActualValue = 1000L;
req.TotalWeight = 20L;
req.DefaultTradeReceiver = true;
AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.SelectedResourceTopDTODomain obj6 = new AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.SelectedResourceTopDTODomain();
obj6.ResourceRequestId = "-";
obj6.ResourceCode = "TMYP_fnlm_fengka";
obj6.ActualFee = 10000L;
req.SelectedResource_ = obj6;
req.PickupCode = "41234";
req.DefaultGenPickupCode = true;
AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.GenPickupCodeConfigTopDTODomain obj7 = new AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest.GenPickupCodeConfigTopDTODomain();
obj7.Group = "A001";
req.GenPickupCodeConfig_ = obj7;
AlibabaAscpLogisticsInstantsonlineCalldeliveryResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest;
$req->setOutOrderId("123456");
$req->setBizType("INSTANT_ONLINE");
$req->setTid("3315117313009520746");
$sender = new SenderTopDTO;
$sender->name="测试发货人";
$sender->phone="15616161616";
$sender->address="测试收地址";
$sender->lat="30.280072";
$sender->lng="120.026851";
$req->setSender(json_encode($sender));
$receiver = new ReceiverTopDTO;
$receiver->name="测试收货人";
$receiver->phone="15818181818";
$receiver->address="测试收货地址";
$receiver->lat="30.275962";
$receiver->lng="120.027276";
$req->setReceiver(json_encode($receiver));
$item_list = new ReceiverTopDTO;
$item_list->item_name="测试商品";
$item_list->item_value="100";
$item_list->item_quantity="1";
$item_list->item_id="705239667995";
$req->setItemList(json_encode($item_list));
$req->setTotalItemValue("1000");
$req->setTotalItemActualValue("1000");
$req->setTotalWeight("20");
$req->setDefaultTradeReceiver("true");
$selected_resource = new SelectedResourceTopDTO;
$selected_resource->resource_request_id="-";
$selected_resource->resource_code="TMYP_fnlm_fengka";
$selected_resource->actual_fee="10000";
$req->setSelectedResource(json_encode($selected_resource));
$req->setPickupCode("41234");
$req->setDefaultGenPickupCode("true");
$gen_pickup_code_config = new GenPickupCodeConfigTopDTO;
$gen_pickup_code_config->group="A001";
$req->setGenPickupCodeConfig(json_encode($gen_pickup_code_config));
$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.ascp.logistics.instantsonline.calldelivery' \
-d 'partner_id=apidoc' \
-d 'session=b087356f-c0c4-4775-8c6f-1a4c0d0ff815' \
-d 'sign=0569A4ACFD0E1839D91CA69E6E1CA646' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-29+18%3A16%3A36' \
-d 'v=2.0' \
-d 'biz_type=INSTANT_ONLINE' \
-d 'default_gen_pickup_code=true' \
-d 'default_trade_receiver=true' \
-d 'gen_pickup_code_config=-' \
-d 'item_list=-' \
-d 'out_order_id=123456' \
-d 'pickup_code=41234' \
-d 'receiver=null' \
-d 'selected_resource=null' \
-d 'sender=null' \
-d 'tid=3315117313009520746' \
-d 'total_item_actual_value=1000' \
-d 'total_item_value=1000' \
-d 'total_weight=20'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaAscpLogisticsInstantsonlineCalldeliveryRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.out_order_id="123456"
req.biz_type="INSTANT_ONLINE"
req.tid=3315117313009520746
req.sender="数据结构示例JSON格式"
req.receiver="数据结构示例JSON格式"
req.item_list="-"
req.total_item_value=1000
req.total_item_actual_value=1000
req.total_weight=20
req.default_trade_receiver=true
req.selected_resource="数据结构示例JSON格式"
req.pickup_code="41234"
req.default_gen_pickup_code=true
req.gen_pickup_code_config="-"
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.ascp.logistics.instantsonline.calldelivery");
add_param(pRequest,"out_order_id","123456");
add_param(pRequest,"biz_type","INSTANT_ONLINE");
add_param(pRequest,"tid","3315117313009520746");
add_param(pRequest,"sender","数据结构JSON示例");
add_param(pRequest,"receiver","数据结构JSON示例");
add_param(pRequest,"item_list","数据结构JSON示例");
add_param(pRequest,"total_item_value","1000");
add_param(pRequest,"total_item_actual_value","1000");
add_param(pRequest,"total_weight","20");
add_param(pRequest,"default_trade_receiver","true");
add_param(pRequest,"selected_resource","数据结构JSON示例");
add_param(pRequest,"pickup_code","41234");
add_param(pRequest,"default_gen_pickup_code","true");
add_param(pRequest,"gen_pickup_code_config","数据结构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.ascp.logistics.instantsonline.calldelivery', {
'out_order_id':'123456',
'biz_type':'INSTANT_ONLINE',
'tid':'3315117313009520746',
'sender':'数据结构JSON示例',
'receiver':'数据结构JSON示例',
'item_list':'数据结构JSON示例',
'total_item_value':'1000',
'total_item_actual_value':'1000',
'total_weight':'20',
'default_trade_receiver':'true',
'selected_resource':'数据结构JSON示例',
'pickup_code':'41234',
'default_gen_pickup_code':'true',
'gen_pickup_code_config':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})