注意:以下文档只适用于TOP接口,请谨慎使用!

文档中心 > 电子面单对接知识库

cainiao.waybill.ii.query.by.waybillcode (通过面单号查询面单打印报文)

通过面单号查询面单的打印报文

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
param_list WaybillDetailQueryByWaybillCodeRequest [] 可选
  • 最大列表长度:20
  • 系统自动生成
    • └ cp_code
    • String
    • 必须
    • POSTB
    • 快递公司code
    • └ object_id
    • String
    • 必须
    • 1
    • 请求id
    • └ waybill_code
    • String
    • 必须
    • 9890000066001
    • 电子面单号

    响应参数

    名称 类型 示例值 描述
    modules WaybillCloudPrintWithResultDescResponse [] x 查询返回值
    • └ error_code
    • String
    • x
    • 错误码
    • └ error_message
    • String
    • x
    • 错误信息
    • └ object_id
    • String
    • x
    • 请求id
    • └ success
    • Boolean
    • x
    • 请求成功
    • waybill_cloud_print_response
    • WaybillCloudPrintResponse
    • x
    • 面单查询结构体
    • └ print_data
    • String
    • x
    • 面单信息
    • └ waybill_code
    • String
    • x
    • 面单号
    • └ parent_waybill_code
    • String
    • x
    • 快运子母件中的母单号

    请求示例

    • JAVA
    • .NET
    • PHP
    • CURL
    • Python
    • C/C++
    • NodeJS
    TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
    CainiaoWaybillIiQueryByWaybillcodeRequest req = new CainiaoWaybillIiQueryByWaybillcodeRequest();
    List<CainiaoWaybillIiQueryByWaybillcodeRequest.WaybillDetailQueryByWaybillCodeRequest> list2 = new ArrayList<CainiaoWaybillIiQueryByWaybillcodeRequest.WaybillDetailQueryByWaybillCodeRequest>();
    CainiaoWaybillIiQueryByWaybillcodeRequest.WaybillDetailQueryByWaybillCodeRequest obj3 = new CainiaoWaybillIiQueryByWaybillcodeRequest.WaybillDetailQueryByWaybillCodeRequest();
    list2.add(obj3);
    obj3.setCpCode("POSTB");
    obj3.setObjectId("1");
    obj3.setWaybillCode("9890000066001");
    req.setParamList(list2);
    CainiaoWaybillIiQueryByWaybillcodeResponse rsp = client.execute(req, sessionKey);
    System.out.println(rsp.getBody());

    响应示例

    • XML示例
    • JSON示例
    <cainiao_waybill_ii_query_by_waybillcode_response>
        <modules>
            <waybill_cloud_print_with_result_desc_response>
                <error_code>x</error_code>
                <error_message>x</error_message>
                <object_id>x</object_id>
                <success>x</success>
                <waybill_cloud_print_response>
                    <print_data>x</print_data>
                    <waybill_code>x</waybill_code>
                    <parent_waybill_code>x</parent_waybill_code>
                </waybill_cloud_print_response>
            </waybill_cloud_print_with_result_desc_response>
        </modules>
    </cainiao_waybill_ii_query_by_waybillcode_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>

    错误码解释

    错误码 错误描述 解决方案
    isp.system default error 系统繁忙 稍后重试
    valid waybill rule not exist 有效的面单号生成规则不存在 检查CpCode是否为空,或者面单号生成规则已废弃
    waybillCode can not be null 商家请求参数不完成,电子面单号不能为空 检查入参
    waybill cpCode can not be null 账户cpCode不允许为空|(检查cpId是否正确)cpCode是否错误 检查入参
    QUERY_CP_ID_BY_CP_CODE_ERROR 查询的物流服务商不存在 检查物流服务商编码是否有误

    API工具

    如何获得此API

    FAQ

    返回
    顶部