全部
电子面单
物流轨迹
物流发货
在线测试

获取面单(非智能)


接口地址: http://api.vv-tool.com/tool/accounts/gcwb


接口介绍: 电子面单云打印接口 点击查看详情


必须用户授权 : 需要用户的授权,才能拿到被授权的数据


请求方式: POST


返回格式: JSON


接口收费: 联系运营


频率限制: 10 次/秒


请求头参数

参数 类型 必选 示例
Authorization string 授权 access_token Bearer 1798c6aadec33d1bc2f5b707f1049aefexxxx

请求参数

名称 类型 必须 示例值 描述
shop_id String true 12345 店铺 ID
param_waybill
_cloud_print_apply_new_request
WaybillCloudPrintApplyNewRequest true 入参信息
cp_code String true POSTB 物流公司 Code,长度小于 20
product_code String false 目前已经不推荐使用此字段,请不要使用 目前已经不推荐使用此字段,请不要使用
sender UserInfoDto true 发货人信息
address AddressDto true 发货地址需要通过 search 接口
city String false 北京市 城市,长度小于 20
detail String true 花家地社区卫生服务站 详细地址,长度小于 256
district String false 朝阳区 区,长度小于 20
province String true 北京 省,长度小于 20
town String false 望京街道 街道,长度小于 30
mobile String false 1326443654 手机号码(手机号和固定电话不能同时为空),长度小于 20
name String true Bar 姓名,长度小于 40
phone String false 057123222 固定电话(手机号和固定电话不能同时为空),长度小于 20
trade_order_info_dtos TradeOrderInfoDto[] true 请求面单信息,数量限制为 10
logistics_services String false 如不需要特殊服务,该值为空 物流服务值(详见https://support-cnkuaidi.taobao.com/doc.htm#?docId=106156&docType=1,如无特殊服务请置空)
object_id String true 1 请求 ID
order_info OrderInfoDto true 订单信息
order_channels_type String true TB 订单渠道平台编码
trade_order_list String[] true 1222221 订单号,数量限制 100,订单号(只限传入数字、字母、下划线和中划线,为避免出现冲突,请按电商平台真实订单号传入,请避免使用同个订单号重复取号)
out_trade_order_list String[] false 123456,456789 外部电商平台交易单号集合,非必填,数量限制 100
out_trade_sub_order_list String[] false 12,34,56,78 外部电商平台交易子单号集合,非必填,数量限制 100
package_info PackageInfoDto true 包裹信息
id String false 1 包裹 id,用于拆合单场景(只能传入数字、字母和下划线;批量请求时值不得重复,大小写敏感,即 123A,123a 不可当做不同 ID,否则存在一定可能取号失败)
items Item[] true 商品信息,数量限制为 100
count Number true 1 数量
name String true 衣服 名称
volume Number false 1 体积, 单位 ml
weight Number false 1 重量,单位 g
total_packages_count Number false 10 子母件模式中的总包裹数/总件数,用于打印当前包裹处于总件数的位置比如 5-2,可以表示总包裹数为 5,当前为第 2 个包裹,只有快运公司需要传入,其他的可以不用传入
packaging_description String false 5 纸 3 木 2 拖 大件快运中的包装方式描述
goods_description String false 服装 大件快运中的货品描述,比如服装,家具
recipient RecipientInfoDto true 收件人信息
address AddressDto true 地址
city String false 北京市 城市
detail String true 花家地社区卫生服务站 详细地址
district String false 朝阳区
province String true 北京
town String false 望京街道 街道
mobile String false 1326443654 手机号码
name String true Bar 姓名
phone String false 057123222 固定电话
oaid String false abcdefghijk 淘宝订单收件人 ID (Open Addressee ID),长度不超过 128 个字符,淘宝订单加密情况用于解密。
tid String false 1527014522198024829 电商平台真实交易订单号,针对电商平台订单隐私加密场景使用,非必填,如果填写则必须是电商平台真实的交易订单 ID
caid String false As268woscee 菜鸟解密地址 ID,用于电商平台收件人信息加密的场景使用,非订单加密场景请勿使用。
template_url String true http://cloudprint.cainiao.com/template/standard/101 云打印标准模板 URL(组装云打印结果使用,值格式http://cloudprint.cainiao.com/template/standard/${模板 ID})
user_id Number true 12 使用者 ID(使用电子面单账号的实际商家 ID,如存在一个电子面单账号多个店铺使用时,请传入店铺的商家 ID)
store_code String false 553323 仓 code, 仓库 WMS 系统对接落地配业务,其它场景请不要使用
resource_code String false DISTRIBUTOR_978324 配送资源 code, 仓库 WMS 系统对接落地配业务,其它场景请不要使用
dms_sorting Boolean false false 是否使用智分宝预分拣, 仓库 WMS 系统对接落地配业务,其它场景请不要使用
three_pl_timing Boolean false false 订单上是否带 3PLtiming 属性, 该属性需要严格与订单上属性保持一致,如果不确定,请使用默认 false。
need_encrypt Boolean false false 设定取号返回的云打印报文是否加密
multi_packages_shipment Boolean false 快递公司支持一票多件,快运公司子母件请勿使用该参数
brand_code String FOP 品牌编码
extra_info String 扩展参数
customer_code String adb123345 月结卡号
call_door_pick_up Boolean false 是否预约上门
door_pick_up_time String 2021-08-07 12:34:30 预约上门收件时间
door_pick_up_end_time String 2021-08-07 12:34:30 预约上门截止时间
shipping_branch_code String 10001 寄件网点编码
vvtype int 普通版 1,不传默认 1,增强版 2,增强版的需要传参 2,标准版 3,需要标准版的传 3

请求示例

{
"shop_id": "227582782",
"param_waybill_cloud_print_apply_new_request": {
"cp_code": "YTO",
"sender": {
"address": {
"detail": "山东省",
"province": "曹县里面的 302"
},
"name": "大哥"
},
"trade_order_info_dtos": [
{
"object_id": "1655",
"order_info": {
"order_channels_type": "TB",
"trade_order_list": [
"5324151342152412421"
]
},
"package_info": {
"items": [
{
"count": "1",
"name": "大风车这样"
}
]
},
"recipient": {
"address": {
"detail": "牛逼 666",
"province": "河南省"
},
"name": "zNXr6j4AMsdafsadassdsadg"
},
"template_url": "http://cloudprint.cainiao.com/template/standard/101",
"user_id": 12

    }]
}

}

请求代码示例

cURL请求代码示例
curl --location --request POST "http://api.vv-tool.com/tool/erps/waybill" \
--header "Authorization: Bearer 762ac11440e85e21weqrqwtwtrwq" \
--header "Content-Type: application/json" \
--header "Cookie: PHPSESSID=6ded377bfo53vo6rbd6mk5l2ea; _csrf=e1edda6cb603e3cfad034b10aab40761e1ef1bacca7becf624004fbfe07c32cfa%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%228vE5OSCWl31W9ilB6idHM4-ykPG3q10I%22%3B%7D" \
--data-raw "{
    "shop_id": "227582782",
    "param_waybill_cloud_print_apply_new_request": {
        "cp_code": "YTO",
        "sender": {
            "address": {
                "detail": "山东省",
                "province": "曹县里面的302"
            },
            "name": "大哥"
        },
        "trade_order_info_dtos": [
            {
                "object_id": "1655",
                "order_info": {
                    "order_channels_type": "TB",
                    "trade_order_list": [
                        "5324151342152412421"
                    ]
                },
                "package_info": {
                    "items": [
                        {
                            "count": "1",
                            "name": "大风车这样"
                        }
                    ]
                },
                "recipient": {
                    "address": {
                        "detail": "牛逼666",
                        "province": "河南省"
                    },
                    "name": "~zNXr6j4AMsdafsadassdsadg~"
                },
                "template_url": "http://cloudprint.cainiao.com/template/standard/101",
                "user_id": 12
            
        }]
    }
}"

PHP请求代码示例

<?php

$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => "http://api.vv-tool.com/tool/erps/waybill",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS =>"{
    "shop_id": "227582782",
    "param_waybill_cloud_print_apply_new_request": {
        "cp_code": "YTO",
        "sender": {
            "address": {
                "detail": "山东省",
                "province": "曹县里面的302"
            },
            "name": "大哥"
        },
        "trade_order_info_dtos": [
            {
                "object_id": "1655",
                "order_info": {
                    "order_channels_type": "TB",
                    "trade_order_list": [
                        "5324151342152412421"
                    ]
                },
                "package_info": {
                    "items": [
                        {
                            "count": "1",
                            "name": "大风车这样"
                        }
                    ]
                },
                "recipient": {
                    "address": {
                        "detail": "牛逼666",
                        "province": "河南省"
                    },
                    "name": "~zNXr6j4AMsdafsadassdsadg~"
                },
                "template_url": "http://cloudprint.cainiao.com/template/standard/101",
                "user_id": 12
            
        }]
    }
}",
  CURLOPT_HTTPHEADER => array(
    "Authorization: Bearer 762ac11440e85e21weqrqwtwtrwq",
    "Content-Type: application/json",
    "Cookie: PHPSESSID=6ded377bfo53vo6rbd6mk5l2ea; _csrf=e1edda6cb603e3cfad034b10aab40761e1ef1bacca7becf624004fbfe07c32cfa%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%228vE5OSCWl31W9ilB6idHM4-ykPG3q10I%22%3B%7D"
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

JAVA请求代码示例
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n    \"shop_id\": \"227582782\",\r\n    \"param_waybill_cloud_print_apply_new_request\": {\r\n        \"cp_code\": \"YTO\",\r\n        \"sender\": {\r\n            \"address\": {\r\n                \"detail\": \"山东省\",\r\n                \"province\": \"曹县里面的302\"\r\n            },\r\n            \"name\": \"大哥\"\r\n        },\r\n        \"trade_order_info_dtos\": [\r\n            {\r\n                \"object_id\": \"1655\",\r\n                \"order_info\": {\r\n                    \"order_channels_type\": \"TB\",\r\n                    \"trade_order_list\": [\r\n                        \"5324151342152412421\"\r\n                    ]\r\n                },\r\n                \"package_info\": {\r\n                    \"items\": [\r\n                        {\r\n                            \"count\": \"1\",\r\n                            \"name\": \"大风车这样\"\r\n                        }\r\n                    ]\r\n                },\r\n                \"recipient\": {\r\n                    \"address\": {\r\n                        \"detail\": \"牛逼666\",\r\n                        \"province\": \"河南省\"\r\n                    },\r\n                    \"name\": \"~zNXr6j4AMsdafsadassdsadg~\"\r\n                },\r\n                \"template_url\": \"http://cloudprint.cainiao.com/template/standard/101\",\r\n                \"user_id\": 12\r\n            \r\n        }]\r\n    }\r\n}");
Request request = new Request.Builder()
  .url("http://api.vv-tool.com/tool/erps/waybill")
  .method("POST", body)
  .addHeader("Authorization", "Bearer 762ac11440e85e21weqrqwtwtrwq")
  .addHeader("Content-Type", "application/json")
  .addHeader("Cookie", "PHPSESSID=6ded377bfo53vo6rbd6mk5l2ea; _csrf=e1edda6cb603e3cfad034b10aab40761e1ef1bacca7becf624004fbfe07c32cfa%3A2%3A%7Bi%3A0%3Bs%3A5%3A%22_csrf%22%3Bi%3A1%3Bs%3A32%3A%228vE5OSCWl31W9ilB6idHM4-ykPG3q10I%22%3B%7D")
  .build();
Response response = client.newCall(request).execute();

响应参数

名称 类型 示例值 描述
modules WaybillCloudPrintResponse [] xx 系统自动生成
object_id String 12 请求 id
waybill_code String 9890000160004 面单号, 子母件模式下为子面单号
print_data String 云打印内容(encryptedData 表示加密结果,data 表示非加密结果);模板内容,具体解释见链接
parent_waybill_code String 9890000160004 子母件中的母单号,当为子母件模式时,需要此单号为实际挂载物流详情的单号,需要使用此单号进行发货,查询物流详情,非子母件,此字段为空
withholding_money int 11 该接口扣费金额(点券)

返回数据

{
    "code": 0,
    "msg": "操作成功",
    "msec": 1460,
    "time": 1617273033,
    "data": 
        {
			 "withholding_money": 1,
            "cainiao_waybill_ii_get_response":{
        "modules":{
            "waybill_cloud_print_response":[
                {
                    "object_id":"12",
                    "waybill_code":"9890000160004",
                    "print_data":"{\\\"data\\\":{\\\"recipient\\\":{\\\"address\\\":{\\\"city\\\":\\\"北京市\\\",\\\"detail\\\":\\\"花家地社区卫生服务站\\\",\\\"district\\\":\\\"朝阳区\\\",\\\"province\\\":\\\"北京\\\",\\\"town\\\":\\\"望京街道\\\"},\\\"mobile\\\":\\\"1326443654\\\",\\\"name\\\":\\\"Bar\\\",\\\"phone\\\":\\\"057123222\\\"},\\\"routingInfo\\\":{\\\"consolidation\\\":{},\\\"origin\\\":{\\\"code\\\":\\\"POSTB\\\"},\\\"sortation\\\":{\\\"name\\\":\\\"杭州\\\"}},\\\"dmsSortingInfo\\\": {\\\"siteAreaCode\\\": \\\"A2\\\"},\\\"sender\\\":{\\\"address\\\":{\\\"city\\\":\\\"北京市\\\",\\\"detail\\\":\\\"花家地社区卫生服务站\\\",\\\"district\\\":\\\"朝阳区\\\",\\\"province\\\":\\\"北京\\\",\\\"town\\\":\\\"望京街道\\\"},\\\"mobile\\\":\\\"1326443654\\\",\\\"name\\\":\\\"Bar\\\",\\\"phone\\\":\\\"057123222\\\"},\\\"shippingOption\\\":{\\\"code\\\":\\\"COD\\\",\\\"services\\\":{\\\"SVC-COD\\\":{\\\"value\\\":\\\"200\\\"}},\\\"title\\\":\\\"代收货款\\\"},\\\"waybillCode\\\":\\\"9890000160004\\\"},\\\"signature\\\":\\\"RSA:hqUkugCY2FFXJK10fRcUE0TsvDppxXuBdOEnPVntF3u4H2yaYiPsPXqjdI1C5oXs60vVCfqd8YC6vZx57TnN9\/u0VYM\/TiFmMtxix9ouPQ2p7G64UyX9BrnRQQCp5ETqJogSzIpxVlz5rx3hy19C+VQrqWgQEw5JqOkoBFXhMi8\\u003d\\\",\\\"templateURL\\\":\\\"http:\/\/cloudprint.cainiao.com\/cloudprint\/template\/getStandardTemplate.json?template_id\\u003d1001\\\"}",
                    "parent_waybill_code":"9890000160004"
                }
            ]
        }
    }
}