TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaAscpIndustryWaybillPreAcceptRequest req = new AlibabaAscpIndustryWaybillPreAcceptRequest();
AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenRequest obj1 = new AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenRequest();
List<AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenItem> list3 = new ArrayList<AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenItem>();
AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenItem obj4 = new AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenItem();
list3.add(obj4);
obj4.setItemId("670885411040");
obj4.setItemQuantity(1L);
obj1.setWaybillGenItemList(list3);
AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenServ obj5 = new AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenServ();
obj5.setDeliveryType("0");
obj1.setWaybillGenServ(obj5);
AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenSender obj6 = new AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenSender();
obj6.setDetailAddress("发货详细地址");
obj6.setSenderProvince("西藏自治区");
obj6.setSenderCity("拉萨市");
obj6.setSenderArea("城关区");
obj1.setWaybillGenSender(obj6);
AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenReceiver obj7 = new AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenReceiver();
obj7.setContactMobile("15005788129");
obj7.setContactName("lzg");
obj7.setDetailAddress("收货详细地址");
obj7.setReceiverProvince("新疆维吾尔自治区");
obj7.setReceiverCity("哈密市");
obj7.setReceiverArea("伊州区");
obj1.setWaybillGenReceiver(obj7);
AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenInfo obj8 = new AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenInfo();
obj8.setTotalVolume("1");
obj8.setGatherNum(0L);
obj8.setRelatedOrderCode("123456");
obj8.setRemark("备注");
obj8.setGather(0L);
obj8.setMainTradeNo("2681486569973546547");
obj8.setSellerId("2206586295985");
obj8.setTotalPackNum(1L);
List<AlibabaAscpIndustryWaybillPreAcceptRequest.ImageUrlInfo> list10 = new ArrayList<AlibabaAscpIndustryWaybillPreAcceptRequest.ImageUrlInfo>();
AlibabaAscpIndustryWaybillPreAcceptRequest.ImageUrlInfo obj11 = new AlibabaAscpIndustryWaybillPreAcceptRequest.ImageUrlInfo();
list10.add(obj11);
obj11.setDownloadUrl("https://xxx,https://");
obj8.setRemarkPicture(list10);
obj8.setOrderChannel(1L);
obj1.setWaybillGenInfo(obj8);
req.setWaybillGenRequest(obj1);
AlibabaAscpIndustryWaybillPreAcceptResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaAscpIndustryWaybillPreAcceptRequest req = new AlibabaAscpIndustryWaybillPreAcceptRequest();
AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenRequestDomain obj1 = new AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenRequestDomain();
List<AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenItemDomain> list3 = new List<AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenItemDomain>();
AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenItemDomain obj4 = new AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenItemDomain();
list3.Add(obj4);
obj4.ItemId = "670885411040";
obj4.ItemQuantity = 1L;
obj1.WaybillGenItemList= list3;
AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenServDomain obj5 = new AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenServDomain();
obj5.DeliveryType = "0";
obj1.WaybillGenServ= obj5;
AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenSenderDomain obj6 = new AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenSenderDomain();
obj6.DetailAddress = "发货详细地址";
obj6.SenderProvince = "西藏自治区";
obj6.SenderCity = "拉萨市";
obj6.SenderArea = "城关区";
obj1.WaybillGenSender= obj6;
AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenReceiverDomain obj7 = new AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenReceiverDomain();
obj7.ContactMobile = "15005788129";
obj7.ContactName = "lzg";
obj7.DetailAddress = "收货详细地址";
obj7.ReceiverProvince = "新疆维吾尔自治区";
obj7.ReceiverCity = "哈密市";
obj7.ReceiverArea = "伊州区";
obj1.WaybillGenReceiver= obj7;
AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenInfoDomain obj8 = new AlibabaAscpIndustryWaybillPreAcceptRequest.WaybillGenInfoDomain();
obj8.TotalVolume = "1";
obj8.GatherNum = 0L;
obj8.RelatedOrderCode = "123456";
obj8.Remark = "备注";
obj8.Gather = 0L;
obj8.MainTradeNo = "2681486569973546547";
obj8.SellerId = "2206586295985";
obj8.TotalPackNum = 1L;
List<AlibabaAscpIndustryWaybillPreAcceptRequest.ImageUrlInfoDomain> list10 = new List<AlibabaAscpIndustryWaybillPreAcceptRequest.ImageUrlInfoDomain>();
AlibabaAscpIndustryWaybillPreAcceptRequest.ImageUrlInfoDomain obj11 = new AlibabaAscpIndustryWaybillPreAcceptRequest.ImageUrlInfoDomain();
list10.Add(obj11);
obj11.DownloadUrl = "https://xxx,https://";
obj8.RemarkPicture= list10;
obj8.OrderChannel = 1L;
obj1.WaybillGenInfo= obj8;
req.WaybillGenRequest_ = obj1;
AlibabaAscpIndustryWaybillPreAcceptResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaAscpIndustryWaybillPreAcceptRequest;
$waybill_gen_request = new WaybillGenRequest;
$waybill_gen_item_list = new WaybillGenItem;
$waybill_gen_item_list->item_id="670885411040";
$waybill_gen_item_list->item_quantity="1";
$waybill_gen_request->waybill_gen_item_list = $waybill_gen_item_list;
$waybill_gen_serv = new WaybillGenServ;
$waybill_gen_serv->delivery_type="0";
$waybill_gen_request->waybill_gen_serv = $waybill_gen_serv;
$waybill_gen_sender = new WaybillGenSender;
$waybill_gen_sender->detail_address="发货详细地址";
$waybill_gen_sender->sender_province="西藏自治区";
$waybill_gen_sender->sender_city="拉萨市";
$waybill_gen_sender->sender_area="城关区";
$waybill_gen_request->waybill_gen_sender = $waybill_gen_sender;
$waybill_gen_receiver = new WaybillGenReceiver;
$waybill_gen_receiver->contact_mobile="15005788129";
$waybill_gen_receiver->contact_name="lzg";
$waybill_gen_receiver->detail_address="收货详细地址";
$waybill_gen_receiver->receiver_province="新疆维吾尔自治区";
$waybill_gen_receiver->receiver_city="哈密市";
$waybill_gen_receiver->receiver_area="伊州区";
$waybill_gen_request->waybill_gen_receiver = $waybill_gen_receiver;
$waybill_gen_info = new WaybillGenInfo;
$waybill_gen_info->total_volume="1";
$waybill_gen_info->gather_num="0";
$waybill_gen_info->related_order_code="123456";
$waybill_gen_info->remark="备注";
$waybill_gen_info->gather="0";
$waybill_gen_info->main_trade_no="2681486569973546547";
$waybill_gen_info->seller_id="2206586295985";
$waybill_gen_info->total_pack_num="1";
$remark_picture = new ImageUrlInfo;
$remark_picture->download_url="https://xxx,https://";
$waybill_gen_info->remark_picture = $remark_picture;
$waybill_gen_info->order_channel="1";
$waybill_gen_request->waybill_gen_info = $waybill_gen_info;
$req->setWaybillGenRequest(json_encode($waybill_gen_request));
$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.industry.waybill.pre.accept' \
-d 'partner_id=apidoc' \
-d 'session=a3fdfe5e-dfe9-4772-a8ae-d21ee577c553' \
-d 'sign=A45CF5B5E74BE17B0B290945B5DD8CEF' \
-d 'sign_method=hmac' \
-d 'timestamp=2025-04-24+17%3A13%3A49' \
-d 'v=2.0' \
-d 'waybill_gen_request=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaAscpIndustryWaybillPreAcceptRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.waybill_gen_request="数据结构示例JSON格式"
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.industry.waybill.pre.accept");
add_param(pRequest,"waybill_gen_request","数据结构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.industry.waybill.pre.accept', {
'waybill_gen_request':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})