TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaTradeOrderCreateRequest req = new AlibabaTradeOrderCreateRequest();
AlibabaTradeOrderCreateRequest.OrderCreateRequest obj1 = new AlibabaTradeOrderCreateRequest.OrderCreateRequest();
AlibabaTradeOrderCreateRequest.LogisticsDetail obj2 = new AlibabaTradeOrderCreateRequest.LogisticsDetail();
AlibabaTradeOrderCreateRequest.Address obj3 = new AlibabaTradeOrderCreateRequest.Address();
obj3.setZip("461670");
obj3.setCountry("United States of America");
obj3.setAddress("Bank of new york");
obj3.setCity("New York");
obj3.setProvinceCode("California");
obj3.setCityCode("NY");
obj3.setContactPerson("james");
AlibabaTradeOrderCreateRequest.Phone obj4 = new AlibabaTradeOrderCreateRequest.Phone();
obj4.setArea("0512");
obj4.setCountry("86");
obj4.setNumber("13890876543");
obj3.setTelephone(obj4);
obj3.setPortCode("frisco");
obj3.setProvince("California");
obj3.setPort("SH");
obj3.setCountryCode("US");
obj3.setAlternateAddress("test");
AlibabaTradeOrderCreateRequest.Phone obj5 = new AlibabaTradeOrderCreateRequest.Phone();
obj5.setArea("SH");
obj5.setCountry("CH");
obj5.setNumber("461670");
obj3.setFax(obj5);
obj2.setShipmentAddress(obj3);
obj2.setShipmentMethod("sea");
obj2.setTradeTerm("FOB");
obj2.setCarrier("DHL");
obj2.setCarrierCode("DHL");
AlibabaTradeOrderCreateRequest.ShipmentDate obj6 = new AlibabaTradeOrderCreateRequest.ShipmentDate();
obj6.setDuration(5L);
AlibabaTradeOrderCreateRequest.DateVo obj7 = new AlibabaTradeOrderCreateRequest.DateVo();
obj7.setFormatDate("2019-11-11");
obj7.setTimeStamp(4123459999L);
obj6.setDate(obj7);
obj6.setType("relative/relative_balance/absolute");
obj2.setShipmentDate(obj6);
obj1.setLogisticsDetail(obj2);
obj1.setFulfillmentChannel("TAD");
AlibabaTradeOrderCreateRequest.PaymentDetail obj8 = new AlibabaTradeOrderCreateRequest.PaymentDetail();
obj8.setShipmentFee("20");
obj8.setTotalAmount("300");
obj8.setProductAmount("200");
obj8.setShipmentInsuranceFee("80");
obj8.setInitialAmount("100");
obj8.setValueAddServiceAmount("0");
obj8.setTaxAmount("0");
obj8.setCurrency("USD");
obj1.setPaymentDetail(obj8);
obj1.setThirdPartyChannel("futu");
AlibabaTradeOrderCreateRequest.Participant obj9 = new AlibabaTradeOrderCreateRequest.Participant();
obj9.setLoginId("ca1090886111");
obj9.setEmail("xinbaoifm@sina.cn");
obj1.setTargetParticipant(obj9);
obj1.setRemark("test");
List<AlibabaTradeOrderCreateRequest.TradeEcologyOrderProduct> list11 = new ArrayList<AlibabaTradeOrderCreateRequest.TradeEcologyOrderProduct>();
AlibabaTradeOrderCreateRequest.TradeEcologyOrderProduct obj12 = new AlibabaTradeOrderCreateRequest.TradeEcologyOrderProduct();
list11.add(obj12);
obj12.setProductId(62337348461L);
obj12.setName("helloworld");
obj12.setSkuId("-1");
obj12.setUnit("set");
obj12.setQuantity("100");
obj12.setUnitPriceStr("2");
obj12.setCurrency("USD");
obj12.setEncryptProductId("XJU123452");
obj12.setProductImage("Hbfa463819ebf485f8a9dc31b871b6764y.jpg");
obj1.setProductList(list11);
obj1.setBizCode("1020702");
obj1.setOperatorEmail("xicat1112@163.com");
req.setParamOrderCreate(obj1);
AlibabaTradeOrderCreateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaTradeOrderCreateRequest req = new AlibabaTradeOrderCreateRequest();
AlibabaTradeOrderCreateRequest.OrderCreateRequestDomain obj1 = new AlibabaTradeOrderCreateRequest.OrderCreateRequestDomain();
AlibabaTradeOrderCreateRequest.LogisticsDetailDomain obj2 = new AlibabaTradeOrderCreateRequest.LogisticsDetailDomain();
AlibabaTradeOrderCreateRequest.AddressDomain obj3 = new AlibabaTradeOrderCreateRequest.AddressDomain();
obj3.Zip = "461670";
obj3.Country = "United States of America";
obj3.Address = "Bank of new york";
obj3.City = "New York";
obj3.ProvinceCode = "California";
obj3.CityCode = "NY";
obj3.ContactPerson = "james";
AlibabaTradeOrderCreateRequest.PhoneDomain obj4 = new AlibabaTradeOrderCreateRequest.PhoneDomain();
obj4.Area = "0512";
obj4.Country = "86";
obj4.Number = "13890876543";
obj3.Telephone= obj4;
obj3.PortCode = "frisco";
obj3.Province = "California";
obj3.Port = "SH";
obj3.CountryCode = "US";
obj3.AlternateAddress = "test";
AlibabaTradeOrderCreateRequest.PhoneDomain obj5 = new AlibabaTradeOrderCreateRequest.PhoneDomain();
obj5.Area = "SH";
obj5.Country = "CH";
obj5.Number = "461670";
obj3.Fax= obj5;
obj2.ShipmentAddress= obj3;
obj2.ShipmentMethod = "sea";
obj2.TradeTerm = "FOB";
obj2.Carrier = "DHL";
obj2.CarrierCode = "DHL";
AlibabaTradeOrderCreateRequest.ShipmentDateDomain obj6 = new AlibabaTradeOrderCreateRequest.ShipmentDateDomain();
obj6.Duration = 5L;
AlibabaTradeOrderCreateRequest.DateVoDomain obj7 = new AlibabaTradeOrderCreateRequest.DateVoDomain();
obj7.FormatDate = "2019-11-11";
obj7.TimeStamp = 4123459999L;
obj6.Date= obj7;
obj6.Type = "relative/relative_balance/absolute";
obj2.ShipmentDate= obj6;
obj1.LogisticsDetail= obj2;
obj1.FulfillmentChannel = "TAD";
AlibabaTradeOrderCreateRequest.PaymentDetailDomain obj8 = new AlibabaTradeOrderCreateRequest.PaymentDetailDomain();
obj8.ShipmentFee = "20";
obj8.TotalAmount = "300";
obj8.ProductAmount = "200";
obj8.ShipmentInsuranceFee = "80";
obj8.InitialAmount = "100";
obj8.ValueAddServiceAmount = "0";
obj8.TaxAmount = "0";
obj8.Currency = "USD";
obj1.PaymentDetail= obj8;
obj1.ThirdPartyChannel = "futu";
AlibabaTradeOrderCreateRequest.ParticipantDomain obj9 = new AlibabaTradeOrderCreateRequest.ParticipantDomain();
obj9.LoginId = "ca1090886111";
obj9.Email = "xinbaoifm@sina.cn";
obj1.TargetParticipant= obj9;
obj1.Remark = "test";
List<AlibabaTradeOrderCreateRequest.TradeEcologyOrderProductDomain> list11 = new List<AlibabaTradeOrderCreateRequest.TradeEcologyOrderProductDomain>();
AlibabaTradeOrderCreateRequest.TradeEcologyOrderProductDomain obj12 = new AlibabaTradeOrderCreateRequest.TradeEcologyOrderProductDomain();
list11.Add(obj12);
obj12.ProductId = 62337348461L;
obj12.Name = "helloworld";
obj12.SkuId = "-1";
obj12.Unit = "set";
obj12.Quantity = "100";
obj12.UnitPriceStr = "2";
obj12.Currency = "USD";
obj12.EncryptProductId = "XJU123452";
obj12.ProductImage = "Hbfa463819ebf485f8a9dc31b871b6764y.jpg";
obj1.ProductList= list11;
obj1.BizCode = "1020702";
obj1.OperatorEmail = "xicat1112@163.com";
req.ParamOrderCreate_ = obj1;
AlibabaTradeOrderCreateResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaTradeOrderCreateRequest;
$param_order_create = new OrderCreateRequest;
$logistics_detail = new LogisticsDetail;
$shipment_address = new Address;
$shipment_address->zip="461670";
$shipment_address->country="United States of America";
$shipment_address->address="Bank of new york";
$shipment_address->city="New York";
$shipment_address->province_code="California";
$shipment_address->city_code="NY";
$shipment_address->contact_person="james";
$telephone = new Phone;
$telephone->area="0512";
$telephone->country="86";
$telephone->number="13890876543";
$shipment_address->telephone = $telephone;
$shipment_address->port_code="frisco";
$shipment_address->province="California";
$shipment_address->port="SH";
$shipment_address->country_code="US";
$shipment_address->alternate_address="test";
$fax = new Phone;
$fax->area="SH";
$fax->country="CH";
$fax->number="461670";
$shipment_address->fax = $fax;
$logistics_detail->shipment_address = $shipment_address;
$logistics_detail->shipment_method="sea";
$logistics_detail->trade_term="FOB";
$logistics_detail->carrier="DHL";
$logistics_detail->carrier_code="DHL";
$shipment_date = new ShipmentDate;
$shipment_date->duration="5";
$date = new DateVo;
$date->format_date="2019-11-11";
$date->time_stamp="4123459999";
$shipment_date->date = $date;
$shipment_date->type="relative/relative_balance/absolute";
$logistics_detail->shipment_date = $shipment_date;
$param_order_create->logistics_detail = $logistics_detail;
$param_order_create->fulfillment_channel="TAD";
$payment_detail = new PaymentDetail;
$payment_detail->shipment_fee="20";
$payment_detail->total_amount="300";
$payment_detail->product_amount="200";
$payment_detail->shipment_insurance_fee="80";
$payment_detail->initial_amount="100";
$payment_detail->value_add_service_amount="0";
$payment_detail->tax_amount="0";
$payment_detail->currency="USD";
$param_order_create->payment_detail = $payment_detail;
$param_order_create->third_party_channel="futu";
$target_participant = new Participant;
$target_participant->login_id="ca1090886111";
$target_participant->email="xinbaoifm@sina.cn";
$param_order_create->target_participant = $target_participant;
$param_order_create->remark="test";
$product_list = new TradeEcologyOrderProduct;
$product_list->product_id="62337348461";
$product_list->name="helloworld";
$product_list->sku_id="-1";
$product_list->unit="set";
$product_list->quantity="100";
$product_list->unit_price_str="2";
$product_list->currency="USD";
$product_list->encrypt_product_id="XJU123452";
$product_list->product_image="Hbfa463819ebf485f8a9dc31b871b6764y.jpg";
$param_order_create->product_list = $product_list;
$param_order_create->biz_code="1020702";
$param_order_create->operator_email="xicat1112@163.com";
$req->setParamOrderCreate(json_encode($param_order_create));
$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.trade.order.create' \
-d 'partner_id=apidoc' \
-d 'session=2a921cd3-134a-4a0a-a905-aae57144a99b' \
-d 'sign=2CB682D967BD24E85BBF0ED40336D8AD' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-22+05%3A09%3A18' \
-d 'v=2.0' \
-d 'param_order_create=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaTradeOrderCreateRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.param_order_create=""
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.trade.order.create");
add_param(pRequest,"param_order_create","数据结构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.trade.order.create', {
'param_order_create':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})