文档中心 > API类目 > ICBU-DropShipping

alibaba.shipping.freight.calculate (阿里巴巴商品运费计算查询接口)

阿里巴巴商品运费计算查询接口

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
param_freight_template_request FreightTemplateRequest 必须 {}
  • └ destination_country
  • String
  • 必须
  • US
  • destination country ISO 3166-2
  • └ product_id
  • Number
  • 必须
  • 213421
  • product id
  • └ quantity
  • Number
  • 必须
  • 3
  • quantity
  • └ zip_code
  • String
  • 可选
  • 90001
  • destination zip code
  • └ dispatch_location
  • String
  • 可选
  • CN
  • 商品发货地,默认CN,CN或US

响应参数

名称 类型 示例值 描述
values LogisticsSolution [] {} pojo
  • └ shipping_type
  • String
  • EXPRESS
  • shipping type
  • └ trade_term
  • String
  • DAP
  • trade term
  • └ dispatch_country
  • String
  • CN
  • dispatch country
  • └ destination_country
  • String
  • US
  • destination country
  • └ vendor_code
  • String
  • EX_ASP_Economy_Express_3C
  • vendor code
  • └ vendor_name
  • String
  • Alibaba.com Economy Express (3C)
  • vendor name
  • fee
  • Price
  • {}
  • shipping fee
  • └ currency
  • String
  • USD
  • currency
  • └ amount
  • String
  • 19.1
  • amount
  • └ delivery_time
  • String
  • 10~15
  • delivery time (days)

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AlibabaShippingFreightCalculateRequest req = new AlibabaShippingFreightCalculateRequest();
AlibabaShippingFreightCalculateRequest.FreightTemplateRequest obj1 = new AlibabaShippingFreightCalculateRequest.FreightTemplateRequest();
obj1.setDestinationCountry("US");
obj1.setProductId(213421L);
obj1.setQuantity(3L);
obj1.setZipCode("90001");
obj1.setDispatchLocation("CN");
req.setParamFreightTemplateRequest(obj1);
AlibabaShippingFreightCalculateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<alibaba_shipping_freight_calculate_response>
    <values>
        <logistics_solution>
            <shipping_type>EXPRESS</shipping_type>
            <trade_term>DAP</trade_term>
            <dispatch_country>CN</dispatch_country>
            <destination_country>US</destination_country>
            <vendor_code>EX_ASP_Economy_Express_3C</vendor_code>
            <vendor_name>Alibaba.com Economy Express (3C)</vendor_name>
            <fee>
                <currency>USD</currency>
                <amount>19.1</amount>
            </fee>
            <delivery_time>10~15</delivery_time>
        </logistics_solution>
    </values>
</alibaba_shipping_freight_calculate_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

返回
顶部