aliexpress.local.logistics.order.create (create logistics order)

create logistics order

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
param1 CreateOrderRequestTopDTO 必须 create logistics order's param
  • sender_address
  • AddressTopDTO
  • 必须
  • sender address
  • └ first_name
  • String
  • 必须
  • Jack
  • first name of sender
  • └ last_name
  • String
  • 必须
  • Bryant
  • last name of sender
  • └ country
  • String
  • 必须
  • Brazil
  • sender's country
  • └ zip_code
  • String
  • 必须
  • 04013060 OR 04013-060
  • zip code of ship from place
  • └ address
  • String
  • 必须
  • Vila Mariana, R. Azevedo Macedo
  • sender's district and street
  • └ federal_tax_id
  • String
  • 可选
  • 123
  • federal tax id(cnpj)
  • └ city
  • String
  • 必须
  • Sao Paulo
  • sender's city
  • └ address_number
  • String
  • 必须
  • 113
  • sender's street number
  • └ cellphone
  • String
  • 可选
  • 1234567890
  • cell phone of sender
  • └ state
  • String
  • 必须
  • Sao Paulo or SP
  • sender's State
  • └ email
  • String
  • 可选
  • testmail@gmail.com
  • email of sender
  • parcel
  • ParcelTopDTO
  • 必须
  • parcel info
  • └ quantity
  • Number
  • 可选
  • 1
  • number of the parcel and there's only one parcel
  • └ parcel_type_code
  • String
  • 必须
  • BAG
  • Type: ENVELOPE, BOX, BAG, TUBE, PALLET
  • └ length
  • String
  • 必须
  • 10
  • Length of the parcel in the shipment order. Default unit: centimeters
  • └ width
  • String
  • 必须
  • 5
  • Width of the parcel in the shipment order. Default unit: centimeters
  • └ weight
  • String
  • 必须
  • 2
  • Actual gross weight of the parcel instead of the weight of the product, nor the added weight of the invoice volumes. Default unit: kilograms
  • └ height
  • String
  • 必须
  • 1
  • Height of the parcel in the shipment order. Default unit: centimeters
  • └ delivery_method_id
  • Number
  • 必须
  • 1
  • Delivery option id selected by a sender
  • └ trade_order_id
  • Number
  • 必须
  • 3014820453131992
  • It's sales order id and a 16-digit number. There will be mapping between trade order and shipment order
  • receipt_address
  • AddressTopDTO
  • 必须
  • receiver address
  • └ first_name
  • String
  • 必须
  • Jack
  • first name of receiver
  • └ last_name
  • String
  • 必须
  • Bryant
  • last name of receiver
  • └ country
  • String
  • 必须
  • Brazil
  • receiver's country
  • └ zip_code
  • String
  • 必须
  • 04013060 OR 04013-060
  • zip code of ship to place
  • └ address
  • String
  • 必须
  • Vila Mariana, R. Azevedo Macedo
  • receiver's district and street
  • └ federal_tax_id
  • String
  • 可选
  • 098.084.769-96
  • CPF of the buyer. Senders can find it on sales order
  • └ city
  • String
  • 必须
  • Sao Paulo
  • receiver's city
  • └ address_number
  • String
  • 必须
  • 113
  • receiver's street number
  • └ cellphone
  • String
  • 可选
  • 1234567890
  • cell phone of receiver
  • └ state
  • String
  • 必须
  • Sao Paulo or SP
  • receiver's State
  • └ email
  • String
  • 可选
  • testmail@gmail.com
  • email of receiver
  • └ additional
  • String
  • 可选
  • Floor 5
  • shipping additional
  • └ logistics_channel_id
  • String
  • 必须
  • 2
  • Logistics provider Id of the shipping order such as 1-Cainiao, 2-Pegaki, 3-Frenet, 4-Delivery Hub, etc.
  • └ provider_shipping_costs
  • String
  • 必须
  • 15
  • Input delivery_cost in logistics method query API. If no value returned, then input 1
  • invoice
  • InvoiceTopDTO
  • 可选
  • invoice info
  • └ invoice_series
  • String
  • 必须
  • 186
  • 3-digit number
  • └ invoice_key
  • String
  • 必须
  • 32210808351293000910550010018677261100007413
  • 44-digit number
  • └ invoice_number
  • String
  • 必须
  • 772611000
  • 9-digit number
  • └ invoice_total_value
  • String
  • 必须
  • 100
  • value of invoice
  • └ invoice_date
  • String
  • 必须
  • 2021-12-26T15:58:11
  • date of inovice issued
  • products
  • ProductTopDTO []
  • 必须
  • products info
  • └ quantity
  • Number
  • 必须
  • 2
  • Quantity of a sku in the order. It's used to calculate the total number of products in a parcel
  • └ price
  • String
  • 可选
  • 1
  • price
  • └ length
  • String
  • 必须
  • 10
  • Actual dimension of a sku in its original packaging. Default unit: centimeters
  • └ width
  • String
  • 必须
  • 10
  • Actual dimension of a sku in its original packaging. Default unit: centimeters
  • └ weight
  • String
  • 必须
  • 2
  • Total weight of a SKU in its original packaging. Default unit: kilograms
  • └ height
  • String
  • 必须
  • 2
  • Actual dimension of a sku in its original packaging. Default unit: centimeters
  • └ sku_id
  • String
  • 可选
  • abc
  • AE sku_id to identify a unit of sku
  • └ query_id
  • String
  • 可选
  • 12345
  • Find it in responses of shipping method query API

响应参数

名称 类型 示例值 描述
data AELogisticsOrderDTO response info
  • └ logistics_order_id
  • String
  • BP10000000015003
  • Shipment order id created. AE will save relationship with logistics provider's shipment order_id
is_success Boolean success interface status
error_result_message String error error message
error_result_code String error_001 error code

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AliexpressLocalLogisticsOrderCreateRequest req = new AliexpressLocalLogisticsOrderCreateRequest();
AliexpressLocalLogisticsOrderCreateRequest.CreateOrderRequestTopDTO obj1 = new AliexpressLocalLogisticsOrderCreateRequest.CreateOrderRequestTopDTO();
AliexpressLocalLogisticsOrderCreateRequest.AddressTopDTO obj2 = new AliexpressLocalLogisticsOrderCreateRequest.AddressTopDTO();
obj2.setFirstName("Jack");
obj2.setLastName("Bryant");
obj2.setCountry("Brazil");
obj2.setZipCode("04013060 OR 04013-060");
obj2.setAddress("Vila Mariana, R. Azevedo Macedo");
obj2.setFederalTaxId("123");
obj2.setCity("Sao Paulo");
obj2.setAddressNumber("113");
obj2.setCellphone("1234567890");
obj2.setState("Sao Paulo or SP");
obj2.setEmail("testmail@gmail.com");
obj1.setSenderAddress(obj2);
AliexpressLocalLogisticsOrderCreateRequest.ParcelTopDTO obj3 = new AliexpressLocalLogisticsOrderCreateRequest.ParcelTopDTO();
obj3.setQuantity(1L);
obj3.setParcelTypeCode("BAG");
obj3.setLength("10");
obj3.setWidth("5");
obj3.setWeight("2");
obj3.setHeight("1");
obj1.setParcel(obj3);
obj1.setDeliveryMethodId(1L);
obj1.setTradeOrderId(3014820453131992L);
AliexpressLocalLogisticsOrderCreateRequest.AddressTopDTO obj4 = new AliexpressLocalLogisticsOrderCreateRequest.AddressTopDTO();
obj4.setFirstName("Jack");
obj4.setLastName("Bryant");
obj4.setCountry("Brazil");
obj4.setZipCode("04013060 OR 04013-060");
obj4.setAddress("Vila Mariana, R. Azevedo Macedo");
obj4.setFederalTaxId("098.084.769-96");
obj4.setCity("Sao Paulo");
obj4.setAddressNumber("113");
obj4.setCellphone("1234567890");
obj4.setState("Sao Paulo or SP");
obj4.setEmail("testmail@gmail.com");
obj4.setAdditional("Floor 5");
obj1.setReceiptAddress(obj4);
obj1.setLogisticsChannelId("2");
obj1.setProviderShippingCosts("15");
AliexpressLocalLogisticsOrderCreateRequest.InvoiceTopDTO obj5 = new AliexpressLocalLogisticsOrderCreateRequest.InvoiceTopDTO();
obj5.setInvoiceSeries("186");
obj5.setInvoiceKey("32210808351293000910550010018677261100007413");
obj5.setInvoiceNumber("772611000");
obj5.setInvoiceTotalValue("100");
obj5.setInvoiceDate("2021-12-26T15:58:11");
obj1.setInvoice(obj5);
List<AliexpressLocalLogisticsOrderCreateRequest.ProductTopDTO> list7 = new ArrayList<AliexpressLocalLogisticsOrderCreateRequest.ProductTopDTO>();
AliexpressLocalLogisticsOrderCreateRequest.ProductTopDTO obj8 = new AliexpressLocalLogisticsOrderCreateRequest.ProductTopDTO();
list7.add(obj8);
obj8.setQuantity(2L);
obj8.setPrice("1");
obj8.setLength("10");
obj8.setWidth("10");
obj8.setWeight("2");
obj8.setHeight("2");
obj8.setSkuId("abc");
obj1.setProducts(list7);
obj1.setQueryId("12345");
req.setParam1(obj1);
AliexpressLocalLogisticsOrderCreateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<aliexpress_local_logistics_order_create_response>
    <data>
        <logistics_order_id>BP10000000015003</logistics_order_id>
    </data>
    <is_success>success</is_success>
    <error_result_message>error</error_result_message>
    <error_result_code>error_001</error_result_code>
</aliexpress_local_logistics_order_create_response>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部