- 授权
- 商品
- 地址
- 价格
- 库存
- 订单
- 售后
- 物流
- 发票
- 类目
- 员工
12.1 发票申请
POST
/api/v2/invoice/create
Invoice
请求参数
Authorization
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token示例:
Authorization: Bearer ********************
Header 参数
channel
string
可选
默认值:
benlai
shopId
string
商城id
默认值:
123
Body 参数application/json
out_trade_no_list
array[string]
商户订单号列表
优先以out_trade_no_list为准
do_id_list
array[string]
出库单列表
优先以out_trade_no_list为准
mark_id
string
第三方申请单号
>= 0 字符<= 64 字符
invoice_type
string
发票类型
POPULAR :增值税普票
>= 0 字符<= 20 字符
content
string
开票内容
DETAIL:明细
>= 0 字符<= 20 字符
invoice_ate
string
期望开票时间
>= 8 字符<= 8 字符
title
string
发票抬头
>= 0 字符<= 64 字符
billing_address
string
注册地址
>= 0 字符<= 200 字符
billing_phone
string
注册电话
正则匹配:
^[1][0-9]{10}$
tax_no
string
税号
>= 0 字符<= 30 字符
bank_name
string
银行名称
>= 0 字符<= 64 字符
bank_account
string
银行账户
>= 0 字符<= 64 字符
apply_amt
number <double>
申请未税金额
apply_tax_amt
number <double>
申请含税金额
bill
object (Benlai.Open.Models.Invoice.BillInfo)
可选
bill_contact
string
姓名
>= 0 字符<= 20 字符
bill_phone
string
联系方式
正则匹配:
^[1][0-9]{10}$
bill_province
string
省
>= 0 字符<= 20 字符
bill_city
string
市
>= 0 字符<= 20 字符
bill_county
string
县(区)
>= 0 字符<= 20 字符
bill_address
string
收货地址
>= 0 字符<= 200 字符
示例
{
"out_trade_no_list":["4900012349"],
"mark_id":"TEST_INVOICE_1742551587374",
"invoice_type":"POPULAR",
"content":"DETAIL",
"invoice_ate":"20250321",
"title":"本来生活",
"billing_address":"现代大厦8喽",
"billing_phone":"17966666666",
"tax_no":"91310000XXXXXXXX1X",
"bank_account":"10002000300040005000",
"bank_name":"中国银行",
"bill":
{
"bill_contact":"张三",
"bill_phone":"13800138000",
"bill_province":"广东省",
"bill_city":"深圳市",
"bill_county":"南山区",
"bill_address":"科技园路1号"
}
}
示例代码
Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://open-agent-branch.benlai.com/api/v2/invoice/create' \
--header 'channel: benlai' \
--header 'shopId: 123' \
--header 'Content-Type: application/json' \
--data-raw '{
"out_trade_no_list":["4900012349"],
"mark_id":"TEST_INVOICE_1742551587374",
"invoice_type":"POPULAR",
"content":"DETAIL",
"invoice_ate":"20250321",
"title":"本来生活",
"billing_address":"现代大厦8喽",
"billing_phone":"17966666666",
"tax_no":"91310000XXXXXXXX1X",
"bank_account":"10002000300040005000",
"bank_name":"中国银行",
"bill":
{
"bill_contact":"张三",
"bill_phone":"13800138000",
"bill_province":"广东省",
"bill_city":"深圳市",
"bill_county":"南山区",
"bill_address":"科技园路1号"
}
}'
返回响应
🟢200成功
text/plain
Body
invoice_id
string
发票申请单号
示例
{
"invoice_id": "string"
}