文档中心 > API文档

aliexpress.logistics.buyer.freight.calculate (提供给买家使用的运费计算接口)

提供给买家使用的运费计算接口

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
param_aeop_freight_calculate_for_buyer_d_t_o AeopFreightCalculateForBuyerDto 必须 运费计算请求参数
  • └ city_code
  • String
  • 可选
  • 99988777
  • 城市编码
  • └ country_code
  • String
  • 必须
  • RU
  • 国家编码
  • └ product_id
  • Number
  • 必须
  • 777777
  • 商品ID
  • └ product_num
  • Number
  • 必须
  • 1
  • 商品数量
  • └ province_code
  • String
  • 可选
  • 888777
  • 省份编码
  • └ send_goods_country_code
  • String
  • 必须
  • CN
  • 发货国家
  • └ price
  • String
  • 可选
  • 1.89
  • 商品价格
  • └ price_currency
  • String
  • 可选
  • USD
  • 商品价格币种

响应参数

名称 类型 示例值 描述
result AeopFreightCalculateResultListResponseForBuyer result result
  • aeop_freight_calculate_result_for_buyer_d_t_o_list
  • AeopFreightCalculateResultForBuyerDto []
  • aeopFreightCalculateResultForBuyerDTOList
  • aeopFreightCalculateResultForBuyerDTOList
  • └ error_code
  • Number
  • 0
  • errorCode
  • └ estimated_delivery_time
  • String
  • 5-8day
  • 预估运达时效
  • freight
  • Money
  • freight
  • 运费
  • └ amount
  • BigDecimal
  • 1.0
  • amount
  • └ cent
  • Number
  • 1000
  • cent
  • └ currency_code
  • String
  • USD
  • currencyCode
  • └ service_name
  • String
  • CAINIAO_STANDARD
  • serviceName
  • └ error_desc
  • String
  • product id is needed.
  • errorDesc
  • └ success
  • Boolean
  • true
  • success

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
AliexpressLogisticsBuyerFreightCalculateRequest req = new AliexpressLogisticsBuyerFreightCalculateRequest();
AliexpressLogisticsBuyerFreightCalculateRequest.AeopFreightCalculateForBuyerDto obj1 = new AliexpressLogisticsBuyerFreightCalculateRequest.AeopFreightCalculateForBuyerDto();
obj1.setCityCode("99988777");
obj1.setCountryCode("RU");
obj1.setProductId(777777L);
obj1.setProductNum(1L);
obj1.setProvinceCode("888777");
obj1.setSendGoodsCountryCode("CN");
obj1.setPrice("1.89");
obj1.setPriceCurrency("USD");
req.setParamAeopFreightCalculateForBuyerDTO(obj1);
AliexpressLogisticsBuyerFreightCalculateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<aliexpress_logistics_buyer_freight_calculate_response>
    <result>
        <aeop_freight_calculate_result_for_buyer_d_t_o_list>
            <aeop_freight_calculate_result_for_buyer_dto>
                <error_code>0</error_code>
                <estimated_delivery_time>5-8day</estimated_delivery_time>
                <freight>
                    <amount>1.0</amount>
                    <cent>1000</cent>
                    <currency_code>USD</currency_code>
                </freight>
                <service_name>CAINIAO_STANDARD</service_name>
            </aeop_freight_calculate_result_for_buyer_dto>
        </aeop_freight_calculate_result_for_buyer_d_t_o_list>
        <error_desc>product id is needed.</error_desc>
        <success>true</success>
    </result>
</aliexpress_logistics_buyer_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

返回
顶部