TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaIntentionOrderSaveRequest req = new AlibabaIntentionOrderSaveRequest();
AlibabaIntentionOrderSaveRequest.IntentionOrderSaveRequest obj1 = new AlibabaIntentionOrderSaveRequest.IntentionOrderSaveRequest();
obj1.setBuyerFax("001-123456789");
obj1.setBuyerTelephone("001-123456789");
obj1.setBuyerEmail("xxx@alibaba.com");
obj1.setRemark("xxx,xxx,xxx");
obj1.setTradeTerm("FOB");
obj1.setBuyerZipCode("201101");
obj1.setOrderAmount("1000");
obj1.setBuyerCity("NewYork");
AlibabaIntentionOrderSaveRequest.IntentionOrderLogistics obj2 = new AlibabaIntentionOrderSaveRequest.IntentionOrderLogistics();
obj2.setShipmentFee("100");
obj2.setCountry("The United States");
obj2.setCity("NewYork");
obj2.setCityCode("NY");
obj2.setContactPerson("Jack Wu");
obj2.setDeparturePort("ShangHai");
obj2.setDeliveryDateType("relative");
obj2.setAddressId("12345678");
obj2.setDeliveryDateRelativeDuration(33L);
obj2.setShipmentMethod("express/air/sea/land:快递/空运/海运/陆运/");
obj2.setProvince("California");
obj2.setDepartureCityCode("SH");
obj2.setCountryCode("US");
obj2.setDeliveryDateAbsoluteTime("2019-10-10 10:00:00");
AlibabaIntentionOrderSaveRequest.Phone obj3 = new AlibabaIntentionOrderSaveRequest.Phone();
obj3.setArea("8");
obj3.setCountry("001");
obj3.setNumber("123456789");
obj2.setFax(obj3);
obj2.setDeparturePortCode("SH");
obj2.setZip("201101");
obj2.setAddress("#20A, 2345 Belmont Avenue, Durham, NC,America");
obj2.setDepartureCity("Shanghai");
obj2.setProvinceCode("CA");
AlibabaIntentionOrderSaveRequest.Phone obj4 = new AlibabaIntentionOrderSaveRequest.Phone();
obj4.setArea("8");
obj4.setCountry("001");
obj4.setNumber("123456789");
obj2.setMobile(obj4);
AlibabaIntentionOrderSaveRequest.Phone obj5 = new AlibabaIntentionOrderSaveRequest.Phone();
obj5.setArea("8");
obj5.setCountry("001");
obj5.setNumber("123456789");
obj2.setTelephone(obj5);
obj2.setPortCode("NY");
obj2.setCarrier("United Parcel Service of America");
obj2.setPort("NewYork");
obj2.setCarrierCode("UPS");
obj2.setAlternateAddress("#20A, 2345 Belmont Avenue, Durham, NC,America");
obj2.setProperties("JSON字符串格式");
obj1.setIntentionOrderLogistics(obj2);
obj1.setCurrency("USD");
obj1.setSourceChannelReferId("12345678");
obj1.setBuyerProvince("California");
obj1.setBuyerContactAddress("#20A, 2345 Belmont Avenue, Durham, NC,America");
obj1.setBuyerCountryPort("NewYork");
List<AlibabaIntentionOrderSaveRequest.IntentionOrderProduct> list7 = new ArrayList<AlibabaIntentionOrderSaveRequest.IntentionOrderProduct>();
AlibabaIntentionOrderSaveRequest.IntentionOrderProduct obj8 = new AlibabaIntentionOrderSaveRequest.IntentionOrderProduct();
list7.add(obj8);
obj8.setProductDesc("xxx,xxx");
obj8.setProductSpec("xxx,xxx");
obj8.setSkuId("1234");
obj8.setQuantity("100");
obj8.setOriginalUnitPrice("12");
obj8.setUnitPrice("10");
obj8.setUnit("Pieces");
obj8.setImageUrl("http://cdn.xxx.com/xxx/xxx");
obj8.setType("Sample/ Customized/Standard");
obj8.setName("mp3 player with bluetooth");
obj8.setProductId(12345678L);
obj8.setProperties("JSON结构字符串");
obj1.setIntentionOrderProducts(list7);
obj1.setBuyerCountryPortCode("NY");
obj1.setIntentionOrderId("12345678");
obj1.setBuyerName("Jack Wu");
obj1.setBuyerCompanyName("Alibaba");
obj1.setBuyerCountryCode("US");
obj1.setBuyerCountry("The United States");
obj1.setAdvancedAmount("300");
obj1.setBuyerProvinceCode("CA");
obj1.setBuyerCityCode("NY");
obj1.setBuyerMobile("001-123456789");
obj1.setProperties("JSON结构字符串");
obj1.setStatus("DRAFT");
req.setIntentionOrder(obj1);
AlibabaIntentionOrderSaveResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());
ITopClient client = new DefaultTopClient(url, appkey, secret);
AlibabaIntentionOrderSaveRequest req = new AlibabaIntentionOrderSaveRequest();
AlibabaIntentionOrderSaveRequest.IntentionOrderSaveRequestDomain obj1 = new AlibabaIntentionOrderSaveRequest.IntentionOrderSaveRequestDomain();
obj1.BuyerFax = "001-123456789";
obj1.BuyerTelephone = "001-123456789";
obj1.BuyerEmail = "xxx@alibaba.com";
obj1.Remark = "xxx,xxx,xxx";
obj1.TradeTerm = "FOB";
obj1.BuyerZipCode = "201101";
obj1.OrderAmount = "1000";
obj1.BuyerCity = "NewYork";
AlibabaIntentionOrderSaveRequest.IntentionOrderLogisticsDomain obj2 = new AlibabaIntentionOrderSaveRequest.IntentionOrderLogisticsDomain();
obj2.ShipmentFee = "100";
obj2.Country = "The United States";
obj2.City = "NewYork";
obj2.CityCode = "NY";
obj2.ContactPerson = "Jack Wu";
obj2.DeparturePort = "ShangHai";
obj2.DeliveryDateType = "relative";
obj2.AddressId = "12345678";
obj2.DeliveryDateRelativeDuration = 33L;
obj2.ShipmentMethod = "express/air/sea/land:快递/空运/海运/陆运/";
obj2.Province = "California";
obj2.DepartureCityCode = "SH";
obj2.CountryCode = "US";
obj2.DeliveryDateAbsoluteTime = "2019-10-10 10:00:00";
AlibabaIntentionOrderSaveRequest.PhoneDomain obj3 = new AlibabaIntentionOrderSaveRequest.PhoneDomain();
obj3.Area = "8";
obj3.Country = "001";
obj3.Number = "123456789";
obj2.Fax= obj3;
obj2.DeparturePortCode = "SH";
obj2.Zip = "201101";
obj2.Address = "#20A, 2345 Belmont Avenue, Durham, NC,America";
obj2.DepartureCity = "Shanghai";
obj2.ProvinceCode = "CA";
AlibabaIntentionOrderSaveRequest.PhoneDomain obj4 = new AlibabaIntentionOrderSaveRequest.PhoneDomain();
obj4.Area = "8";
obj4.Country = "001";
obj4.Number = "123456789";
obj2.Mobile= obj4;
AlibabaIntentionOrderSaveRequest.PhoneDomain obj5 = new AlibabaIntentionOrderSaveRequest.PhoneDomain();
obj5.Area = "8";
obj5.Country = "001";
obj5.Number = "123456789";
obj2.Telephone= obj5;
obj2.PortCode = "NY";
obj2.Carrier = "United Parcel Service of America";
obj2.Port = "NewYork";
obj2.CarrierCode = "UPS";
obj2.AlternateAddress = "#20A, 2345 Belmont Avenue, Durham, NC,America";
obj2.Properties = "JSON字符串格式";
obj1.IntentionOrderLogistics= obj2;
obj1.Currency = "USD";
obj1.SourceChannelReferId = "12345678";
obj1.BuyerProvince = "California";
obj1.BuyerContactAddress = "#20A, 2345 Belmont Avenue, Durham, NC,America";
obj1.BuyerCountryPort = "NewYork";
List<AlibabaIntentionOrderSaveRequest.IntentionOrderProductDomain> list7 = new List<AlibabaIntentionOrderSaveRequest.IntentionOrderProductDomain>();
AlibabaIntentionOrderSaveRequest.IntentionOrderProductDomain obj8 = new AlibabaIntentionOrderSaveRequest.IntentionOrderProductDomain();
list7.Add(obj8);
obj8.ProductDesc = "xxx,xxx";
obj8.ProductSpec = "xxx,xxx";
obj8.SkuId = "1234";
obj8.Quantity = "100";
obj8.OriginalUnitPrice = "12";
obj8.UnitPrice = "10";
obj8.Unit = "Pieces";
obj8.ImageUrl = "http://cdn.xxx.com/xxx/xxx";
obj8.Type = "Sample/ Customized/Standard";
obj8.Name = "mp3 player with bluetooth";
obj8.ProductId = 12345678L;
obj8.Properties = "JSON结构字符串";
obj1.IntentionOrderProducts= list7;
obj1.BuyerCountryPortCode = "NY";
obj1.IntentionOrderId = "12345678";
obj1.BuyerName = "Jack Wu";
obj1.BuyerCompanyName = "Alibaba";
obj1.BuyerCountryCode = "US";
obj1.BuyerCountry = "The United States";
obj1.AdvancedAmount = "300";
obj1.BuyerProvinceCode = "CA";
obj1.BuyerCityCode = "NY";
obj1.BuyerMobile = "001-123456789";
obj1.Properties = "JSON结构字符串";
obj1.Status = "DRAFT";
req.IntentionOrder_ = obj1;
AlibabaIntentionOrderSaveResponse rsp = client.Execute(req, sessionKey);
Console.WriteLine(rsp.Body);
$c = new TopClient;
$c->appkey = $appkey;
$c->secretKey = $secret;
$req = new AlibabaIntentionOrderSaveRequest;
$intention_order = new IntentionOrderSaveRequest;
$intention_order->buyer_fax="001-123456789";
$intention_order->buyer_telephone="001-123456789";
$intention_order->buyer_email="xxx@alibaba.com";
$intention_order->remark="xxx,xxx,xxx";
$intention_order->trade_term="FOB";
$intention_order->buyer_zip_code="201101";
$intention_order->order_amount="1000";
$intention_order->buyer_city="NewYork";
$intention_order_logistics = new IntentionOrderLogistics;
$intention_order_logistics->shipment_fee="100";
$intention_order_logistics->country="The United States";
$intention_order_logistics->city="NewYork";
$intention_order_logistics->city_code="NY";
$intention_order_logistics->contact_person="Jack Wu";
$intention_order_logistics->departure_port="ShangHai";
$intention_order_logistics->delivery_date_type="relative";
$intention_order_logistics->address_id="12345678";
$intention_order_logistics->delivery_date_relative_duration="33";
$intention_order_logistics->shipment_method="express/air/sea/land:快递/空运/海运/陆运/";
$intention_order_logistics->province="California";
$intention_order_logistics->departure_city_code="SH";
$intention_order_logistics->country_code="US";
$intention_order_logistics->delivery_date_absolute_time="2019-10-10 10:00:00";
$fax = new Phone;
$fax->area="8";
$fax->country="001";
$fax->number="123456789";
$intention_order_logistics->fax = $fax;
$intention_order_logistics->departure_port_code="SH";
$intention_order_logistics->zip="201101";
$intention_order_logistics->address="#20A, 2345 Belmont Avenue, Durham, NC,America";
$intention_order_logistics->departure_city="Shanghai";
$intention_order_logistics->province_code="CA";
$mobile = new Phone;
$mobile->area="8";
$mobile->country="001";
$mobile->number="123456789";
$intention_order_logistics->mobile = $mobile;
$telephone = new Phone;
$telephone->area="8";
$telephone->country="001";
$telephone->number="123456789";
$intention_order_logistics->telephone = $telephone;
$intention_order_logistics->port_code="NY";
$intention_order_logistics->carrier="United Parcel Service of America";
$intention_order_logistics->port="NewYork";
$intention_order_logistics->carrier_code="UPS";
$intention_order_logistics->alternate_address="#20A, 2345 Belmont Avenue, Durham, NC,America";
$intention_order_logistics->properties="JSON字符串格式";
$intention_order->intention_order_logistics = $intention_order_logistics;
$intention_order->currency="USD";
$intention_order->source_channel_refer_id="12345678";
$intention_order->buyer_province="California";
$intention_order->buyer_contact_address="#20A, 2345 Belmont Avenue, Durham, NC,America";
$intention_order->buyer_country_port="NewYork";
$intention_order_products = new IntentionOrderProduct;
$intention_order_products->product_desc="xxx,xxx";
$intention_order_products->product_spec="xxx,xxx";
$intention_order_products->sku_id="1234";
$intention_order_products->quantity="100";
$intention_order_products->original_unit_price="12";
$intention_order_products->unit_price="10";
$intention_order_products->unit="Pieces";
$intention_order_products->image_url="http://cdn.xxx.com/xxx/xxx";
$intention_order_products->type="Sample/ Customized/Standard";
$intention_order_products->name="mp3 player with bluetooth";
$intention_order_products->product_id="12345678";
$intention_order_products->properties="JSON结构字符串";
$intention_order->intention_order_products = $intention_order_products;
$intention_order->buyer_country_port_code="NY";
$intention_order->intention_order_id="12345678";
$intention_order->buyer_name="Jack Wu";
$intention_order->buyer_company_name="Alibaba";
$intention_order->buyer_country_code="US";
$intention_order->buyer_country="The United States";
$intention_order->advanced_amount="300";
$intention_order->buyer_province_code="CA";
$intention_order->buyer_city_code="NY";
$intention_order->buyer_mobile="001-123456789";
$intention_order->properties="JSON结构字符串";
$intention_order->status="DRAFT";
$req->setIntentionOrder(json_encode($intention_order));
$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.intention.order.save' \
-d 'partner_id=apidoc' \
-d 'session=bc91e809-5400-4f91-bfd7-a9c7fd1e5397' \
-d 'sign=B203FB1B231CA01BE744755BBEF734F0' \
-d 'sign_method=hmac' \
-d 'timestamp=2024-11-22+04%3A31%3A31' \
-d 'v=2.0' \
-d 'intention_order=null'
# -*- coding: utf-8 -*-
import top.api
req=top.api.AlibabaIntentionOrderSaveRequest(url,port)
req.set_app_info(top.appinfo(appkey,secret))
req.intention_order=""
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.intention.order.save");
add_param(pRequest,"intention_order","数据结构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.intention.order.save', {
'intention_order':'数据结构JSON示例'
}, function(error, response) {
if (!error) console.log(response);
else console.log(error);
})