文档中心 > API类目 > 菜鸟集货API

cainiao.global.im.pickup.bigbag.express.prequery (首公里揽收-快递预查询服务)

快递预查询服务

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
express_pre_query_request ExpressPreQueryRequest 必须 快递预查询服务请求参数
  • └ planned_shipping_date_and_time
  • String
  • 必须
  • xxxxx
  • 期望揽收日期以及时间
  • sender_info
  • ContactInfoRequest
  • 必须
  • senderInfo
  • └ name
  • String
  • 必须
  • xxxxx
  • 名称
  • └ company_name
  • String
  • 必须
  • xxxxx
  • 公司
  • └ phone
  • String
  • 必须
  • xxxxx
  • 电话
  • └ email
  • String
  • 必须
  • xxxxx
  • 邮件
  • └ country
  • String
  • 必须
  • xxxxx
  • 国家
  • └ province
  • String
  • 可选
  • xxxxx
  • 省份
  • └ city
  • String
  • 必须
  • xxxxx
  • 城市
  • └ detail_address
  • String
  • 必须
  • xxxxx
  • 详细地址(最大135个字符)
  • └ zip_code
  • String
  • 必须
  • xxxxx
  • 邮件
  • └ area_id
  • Number
  • 可选
  • 3
  • 地区id
  • └ country_id
  • Number
  • 必须
  • 3
  • 国家id
  • receiver_info
  • ContactInfoRequest
  • 必须
  • receiverInfo
  • └ name
  • String
  • 必须
  • xxxxx
  • 名称
  • └ company_name
  • String
  • 必须
  • xxxxx
  • 公司名称
  • └ phone
  • String
  • 必须
  • xxxxx
  • 电话
  • └ email
  • String
  • 必须
  • xxxxx
  • 邮件
  • └ country
  • String
  • 必须
  • xxxxx
  • 国家
  • └ province
  • String
  • 可选
  • xxxxx
  • 省份
  • └ city
  • String
  • 必须
  • xxxxx
  • 城市
  • └ detail_address
  • String
  • 必须
  • xxxxx
  • 详细地址(最大135个字符)
  • └ zip_code
  • String
  • 必须
  • xxxxx
  • 邮件
  • └ area_id
  • Number
  • 可选
  • 3
  • 地区id
  • └ country_id
  • Number
  • 必须
  • 3
  • 国家id
  • └ scitem_info
  • String
  • 必须
  • xxxxx
  • scItemInfo
  • packages
  • HandoverPackageInfo []
  • 必须
  • packages
  • └ length
  • String
  • 必须
  • xxxxx
  • 大包长(CM)
  • └ width
  • String
  • 必须
  • xxxxx
  • 大包宽(CM)
  • └ height
  • String
  • 必须
  • xxxxx
  • 大包高(CM)
  • └ weight
  • String
  • 必须
  • xxxxx
  • 大包重量(KG)
  • └ seller_id
  • Number
  • 必须
  • 22222
  • 商家id
  • └ receive_cp_code
  • String
  • 必须
  • TRAN_STORE_30690953
  • 揽收cp资源code

响应参数

名称 类型 示例值 描述
hsf_result HsfResult xxxxx hsfResult
  • └ success
  • Boolean
  • false
  • success
  • └ error_code
  • String
  • xxxxx
  • errorCode
  • └ internal_error_code
  • String
  • xxxxx
  • internalErrorCode
  • └ error_msg
  • String
  • xxxxx
  • errorMsg
  • express_pre_query_response_list
  • ExpressPreQueryResponse []
  • data
  • └ product_code
  • String
  • EXPRESS
  • 产品code
  • └ product_name
  • String
  • 1-2 DAY
  • 产品名称
  • └ local_cutoff_date_and_time
  • String
  • 2021-11-18 20:21:22
  • 揽收地址当地截单时间
  • └ estimated_delivery_time
  • String
  • 2021-11-20 20:21:22
  • 预计送达时间
  • └ pickup_earliest
  • String
  • 09:30:00
  • 最早揽收时间
  • └ pickup_latest
  • String
  • 16:00:00
  • 最晚揽收时间
  • └ total_transit_days
  • Number
  • 2
  • 运输总天数

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
CainiaoGlobalImPickupBigbagExpressPrequeryRequest req = new CainiaoGlobalImPickupBigbagExpressPrequeryRequest();
CainiaoGlobalImPickupBigbagExpressPrequeryRequest.ExpressPreQueryRequest obj1 = new CainiaoGlobalImPickupBigbagExpressPrequeryRequest.ExpressPreQueryRequest();
obj1.setPlannedShippingDateAndTime("xxxxx");
CainiaoGlobalImPickupBigbagExpressPrequeryRequest.ContactInfoRequest obj2 = new CainiaoGlobalImPickupBigbagExpressPrequeryRequest.ContactInfoRequest();
obj2.setName("xxxxx");
obj2.setCompanyName("xxxxx");
obj2.setPhone("xxxxx");
obj2.setEmail("xxxxx");
obj2.setCountry("xxxxx");
obj2.setProvince("xxxxx");
obj2.setCity("xxxxx");
obj2.setDetailAddress("xxxxx");
obj2.setZipCode("xxxxx");
obj2.setAreaId(3L);
obj2.setCountryId(3L);
obj1.setSenderInfo(obj2);
CainiaoGlobalImPickupBigbagExpressPrequeryRequest.ContactInfoRequest obj3 = new CainiaoGlobalImPickupBigbagExpressPrequeryRequest.ContactInfoRequest();
obj3.setName("xxxxx");
obj3.setCompanyName("xxxxx");
obj3.setPhone("xxxxx");
obj3.setEmail("xxxxx");
obj3.setCountry("xxxxx");
obj3.setProvince("xxxxx");
obj3.setCity("xxxxx");
obj3.setDetailAddress("xxxxx");
obj3.setZipCode("xxxxx");
obj3.setAreaId(3L);
obj3.setCountryId(3L);
obj1.setReceiverInfo(obj3);
obj1.setScitemInfo("xxxxx");
List<CainiaoGlobalImPickupBigbagExpressPrequeryRequest.HandoverPackageInfo> list5 = new ArrayList<CainiaoGlobalImPickupBigbagExpressPrequeryRequest.HandoverPackageInfo>();
CainiaoGlobalImPickupBigbagExpressPrequeryRequest.HandoverPackageInfo obj6 = new CainiaoGlobalImPickupBigbagExpressPrequeryRequest.HandoverPackageInfo();
list5.add(obj6);
obj6.setLength("xxxxx");
obj6.setWidth("xxxxx");
obj6.setHeight("xxxxx");
obj6.setWeight("xxxxx");
obj1.setPackages(list5);
obj1.setSellerId(22222L);
obj1.setReceiveCpCode("TRAN_STORE_30690953");
req.setExpressPreQueryRequest(obj1);
CainiaoGlobalImPickupBigbagExpressPrequeryResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<cainiao_global_im_pickup_bigbag_express_prequery_response>
    <hsf_result>
        <success>false</success>
        <error_code>xxxxx</error_code>
        <internal_error_code>xxxxx</internal_error_code>
        <error_msg>xxxxx</error_msg>
        <express_pre_query_response_list>
            <express_pre_query_response>
                <product_code>EXPRESS</product_code>
                <product_name>1-2 DAY</product_name>
                <local_cutoff_date_and_time>2021-11-18 20:21:22</local_cutoff_date_and_time>
                <estimated_delivery_time>2021-11-20 20:21:22</estimated_delivery_time>
                <pickup_earliest>09:30:00</pickup_earliest>
                <pickup_latest>16:00:00</pickup_latest>
                <total_transit_days>2</total_transit_days>
            </express_pre_query_response>
        </express_pre_query_response_list>
    </hsf_result>
</cainiao_global_im_pickup_bigbag_express_prequery_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

返回
顶部