将出租车电子发票插入微信用户卡包
更新时间:2024.11.18||
服务商开具出租车电子发票后,调用本接口将发票插入微信用户的卡包。调用本接口需要发票文件ID,可调用【上传出租车电子发票文件】来获取。
接口说明
请求方式:【POST】/v3/taxi-invoice/cards
请求域名:【主域名】https://api.mch.weixin.qq.com 使用该域名将访问就近的接入点
【备域名】https://api2.mch.weixin.qq.com 使用该域名将访问异地的接入点 ,指引点击查看
请求参数
折叠全部参数
Header HTTP头参数
Authorization 必填 string
Accept 必填 string
Content-Type 必填 string
body 包体参数
company_mchid 必填 string(32)
【出租车经营主体商户号】该发票关联的出租车经营主体的商户号
token 必填 string(1024)
【获取乘客行程单详情的凭证】获取乘客行程单详情的凭证
appid 必填 string(128)
【微信用户申请开票使用的AppID】微信用户申请开票使用的公众号或小程序的AppID
openid 必填 string(128)
【微信用户OpenID】微信用户在此AppID下的用户标识,发票卡券会插入该用户的卡包
region_id 必填 integer
fapiao_card_information 必填 object
 | 属性 |
| fapiao_media_id 必填 string(128) 【电子发票文件ID】上传的电子发票文件对应的ID,可通过调用【将出租车电子发票插入微信用户卡包】获取。
fapiao_number 必填 string(8)
fapiao_code 必填 string(12)
fapiao_time 必填 string(32)
check_code 必填 string(20)
password 必填 string(1024)
total_amount 必填 integer 【总价税合计】总价税合计,所有发票行单行金额合计的累加,单位:分
tax_amount 必填 integer 【总税额】总税额,所有发票行单行税额的累加,单位:分
amount 必填 integer 【总金额】总金额,所有发票行单行金额的累加,单位:分
buyer_information 必填 object  | 属性 | | type 必填 string 可选取值:
name 必填 string(80)
taxpayer_id 选填 string(20) 【纳税人识别号】购买方纳税人识别号,购买方类型为ORGANIZATION时必须存在
address 选填 string(80)
telephone 选填 string(20)
bank_name 选填 string(70)
bank_account 选填 string(30) |
seller_information 必填 object  | 属性 | | name 必填 string(80)
taxpayer_id 必填 string(20)
address 必填 string(80)
telephone 选填 string(20)
bank_name 选填 string(70)
bank_account 选填 string(30) |
extra_information 必填 object  | 属性 | | payee 选填 string(16)
reviewer 选填 string(16)
drawer 必填 string(20) |
items 选填 array[object]  | 属性 | | tax_code 必填 string(32) 【货物或应税劳务、服务编码】货物或应税劳务、服务编码
goods_name 必填 string(128) 【货物或应税劳务、服务名称】货物或应税劳务、服务名称
specification 选填 string(40)
unit 选填 string(14)
quantity 必填 integer 【数量】数量,单位为10-8分,100000000表示数量为1
unit_price 必填 integer 【单价】单价,单位为10-6分,100000000表示1元
amount 必填 integer
tax_amount 必填 integer
total_amount 必填 integer
tax_rate 必填 integer 【税率】税率,单位为万分之一,如1300代表13%
tax_prefer_mark 必填 string 可选取值:
discount 必填 boolean 【是否折扣行】指定该发票行是否折扣行,折扣行一定是被折扣行的下一行
|
remark 选填 string(200) |
请求示例
POST

1curl -X POST \
2 https://api.mch.weixin.qq.com/v3/taxi-invoice/cards \
3 -H "Authorization: WECHATPAY2-SHA256-RSA2048 mchid=\"1900000001\",..." \
4 -H "Accept: application/json" \
5 -H "Content-Type: application/json" \
6 -d '{
7 "company_mchid" : "1900000109",
8 "token" : "ESvqG19gjw0qiiy1eeRA4VusLrOmIYQOMJ8rXX2V-ztUUuQvu_YBEZg9FAht0Y15r71mft9rcaMIjn7y6x0KSg",
9 "appid" : "wxb1170446a4c0a5a2",
10 "openid" : "oUypO5aQ1oOCaSiNZUpT5kxxJHuc",
11 "region_id" : 310100,
12 "fapiao_card_information" : {
13 "fapiao_media_id" : "ASNFZ4mrze/+3LqYdlQyEA==",
14 "fapiao_number" : "12897794",
15 "fapiao_code" : "044001911211",
16 "fapiao_time" : "2020-07-01T12:00:00+08:00",
17 "check_code" : "69001808340631374774",
18 "password" : "006>299-375/326>2+7/*0-+<351059<80<4*/5>+<11631+*3030/5*37+/-243159658+013>3409*044>4-/1+/9->*>69501*6++1997--21",
19 "total_amount" : 382895,
20 "tax_amount" : 44050,
21 "amount" : 338845,
22 "buyer_information" : {
23 "type" : "CORPORATION",
24 "name" : "深圳市南山区测试企业",
25 "taxpayer_id" : "202003261233701778",
26 "address" : "深圳市南山区深南大道10000号",
27 "telephone" : "075512345678",
28 "bank_name" : "测试银行",
29 "bank_account" : "62001234567890"
30 },
31 "seller_information" : {
32 "name" : "深圳市南山区测试公司",
33 "taxpayer_id" : "202003261233701778",
34 "address" : "深圳市南山区深南大道10000号",
35 "telephone" : "075512345678",
36 "bank_name" : "测试银行",
37 "bank_account" : "62001234567890"
38 },
39 "extra_information" : {
40 "payee" : "张三",
41 "reviewer" : "李四",
42 "drawer" : "王五"
43 },
44 "items" : [
45 {
46 "tax_code" : "3010101020203000000",
47 "goods_name" : "出租汽车客运服务",
48 "specification" : "A4",
49 "unit" : "次",
50 "quantity" : 100000000,
51 "unit_price" : 380442000000,
52 "amount" : 380442,
53 "tax_amount" : 49458,
54 "total_amount" : 429900,
55 "tax_rate" : 1300,
56 "tax_prefer_mark" : "NO_FAVORABLE",
57 "discount" : false
58 }
59 ],
60 "remark" : "备注"
61 }
62 }'
63应答参数
应答示例
204 No Content

1'无应答包体'
2
错误码
公共错误码
|
400 | PARAM_ERROR | 参数错误 | 请根据错误提示正确传入参数 |
400 | INVALID_REQUEST | HTTP 请求不符合微信支付 APIv3 接口规则 | 请参阅 接口规则 |
401 | SIGN_ERROR | 验证不通过 | 请参阅 签名常见问题 |
500 | SYSTEM_ERROR | 系统异常,请稍后重试 | 请稍后重试 |
业务错误码
|
400 | PARAM_ERROR | 请检查参数格式是否符合要求 | 请使用正确的参数重新调用 |
403 | NO_AUTH | 出租车公司不属于服务商 | 请检查出租车经营主体商户号,确认是【新增出租车公司】接口返回的商户号 |
403 | NO_AUTH | 服务商无权限 | 请检查是否已经开通出租车电子发票产品相关功能权限 |
404 | NOT_FOUND | 所查询的出租车不存在 | 请检查车牌号和行政区划代码 |
404 | NOT_FOUND | 所查询的出租车司机不存在 | 请检查营运资格证号和行政区划代码 |
404 | NOT_FOUND | 未找到指定的出租车经营主体信息 | 请检查出租车经营主体商户号和行政区划代码,确认公司存在且没有下线 |