# 新增面单模板

# 接口调用请求说明

POST https://api.weixin.qq.com/channels/ec/logistics/ewaybill/biz/template/create?access_token=ACCESS_TOKEN

商家新增面单模板。

# 请求参数示例

{
	"delivery_id": "xxxx",
	"info": {
		"template_name": "name_xxxx",
		"template_desc": "快递一联单",
		"template_type": "single",
		"options": [{
				"option_id": 0,
				"font_size": 0,
				"is_bold": false,
				"is_open": false
			},
			{
				"option_id": 1,
				"font_size": 0,
				"is_bold": false,
				"is_open": true
			},
			{
				"option_id": 2,
				"font_size": 0,
				"is_bold": false,
				"is_open": false
			},
			{
				"option_id": 3,
				"font_size": 0,
				"is_bold": false,
				"is_open": false
			},
			{
				"option_id": 4,
				"font_size": 0,
				"is_bold": false,
				"is_open": true
			},
			{
				"option_id": 5,
				"font_size": 0,
				"is_bold": false,
				"is_open": true
			},
			{
				"option_id": 6,
				"font_size": 0,
				"is_bold": false,
				"is_open": true
			},
			{
				"option_id": 7,
				"font_size": 0,
				"is_bold": false,
				"is_open": true
			}
		],
		"is_default": true
	}
}

# 回包示例

{
    "errcode": 0,
    "errmsg": "ok",
    "delivery_id": "XXX",
    "template_id": "xxxxxxxxxx"
}

# 请求参数说明

参数 是否必填 类型 说明
delivery_id Yes String 快递公司编码
info Yes TemplateInfo 模板信息

TemplateInfo的结构体定义

参数 是否必填 类型 说明
template_name Yes String 模板名, 同一快递公司下不可重复
template_desc No String 模板描述 默认填 "一联单标准模板"
template_type No String 模板类型 默认填 "single"
options Yes Array[TemplateOptionPro] 模板信息选项,总数必须为8个,顺序按照数组序
is_default Yes Boolean 是否为该快递公司默认模板

TemplateOptionPro 的结构体定义

参数 是否必填 类型 说明
option_id Yes Number 信息类型,填0-7, 不得重复
font_size Yes Number 打印字号,0 默认大小,1 加大
is_bold No Boolean 字体是否加粗
is_open No Boolean 是否选用此信息

option_id 的取值范围

取值 说明
0 商品总数量
1 商品名称+规格+编码+数量
2 商品名称+规格+数量
3 商品名称+数量
4 店铺名称
5 订单号
6 买家留言
7 卖家备注

# 回包参数说明

参数 类型 说明
errcode Number 错误码
errmsg String 错误信息
delivery_id String 快递公司编码
template_id String 模板编码

# 错误码

错误码 错误信息
公共错误码 点击查看
10025102 快递公司不支持
10025103 同一快递公司下,模板id重复
10025104 同一快递公司下 模板名重复
10025105 模板名太长,size > 200
10025106 模板ID不存在
10025107 options 长度错误
10025108 options.option_id 参数不合法
10025109 模板名为空
10025110 模板ID为空