Skip to content

将出租车电子发票插入微信用户卡包

服务商开具出租车电子发票后,调用本接口将发票插入微信用户的卡包。调用本接口需要发票文件ID,可调用【上传出租车电子发票文件】来获取。

请求参数类型描述
jsonobject声明请求的JSON数据结构
company_mchidstring出租车经营主体商户号
trade_numberstring面对面付款单号
appidstring应用ID
openidstring用户标识
region_idinteger行政区划代码
driver_licensestring营运资格证号
plate_numberstring车牌号
fapiao_card_informationobject发票卡券信息
fapiao_media_idstring电子发票文件ID
fapiao_numberstring发票号码
fapiao_codestring发票代码
fapiao_timestring开票时间
check_codestring校验码
passwordstring密码
total_amountinteger总价税合计
tax_amountinteger总税额
amountinteger总金额
buyer_informationobject购买方信息
typestring购买方类型
namestring名称
taxpayer_idstring纳税人识别号
addressstring地址
telephonestring电话
bank_namestring开户银行
bank_accountstring银行账号
seller_informationobject销售方信息
namestring名称
taxpayer_idstring纳税人识别号
addressstring地址
telephonestring电话
bank_namestring开户银行
bank_accountstring银行账号
extra_informationobject附加信息
payeestring收款人
reviewerstring复核人
drawerstring开票人
itemsobject[]发票行信息
tax_codestring货物或应税劳务、服务编码
goods_namestring货物或应税劳务、服务名称
specificationstring规格型号
unitstring单位
quantityinteger数量
unit_priceinteger单价
amountinteger单行金额
tax_amountinteger单行税额
total_amountinteger单行金额合计
tax_rateinteger税率
tax_prefer_markstring税收优惠政策标识
discountboolean是否折扣行
remarkstring备注信息
php
$instance->v3->taxiInvoice->cards->postAsync([
  'json' => [
    'company_mchid' => '1900000109',
    'trade_number' => '10001071012021110600437180176110',
    'appid' => 'wxb1170446a4c0a5a2',
    'openid' => 'oUypO5aQ1oOCaSiNZUpT5kxxJHuc',
    'region_id' => 310100,
    'driver_license' => '6298416',
    'plate_number' => '浙AD12345',
    'fapiao_card_information' => [
      'fapiao_media_id' => 'ASNFZ4mrze/+3LqYdlQyEA==',
      'fapiao_number' => '12897794',
      'fapiao_code' => '044001911211',
      'fapiao_time' => '2020-07-01T12:00:00+08:00',
      'check_code' => '69001808340631374774',
      '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',
      'total_amount' => 382895,
      'tax_amount' => 44050,
      'amount' => 338845,
      'buyer_information' => [
        'type' => 'CORPORATION',
        'name' => '深圳市南山区测试企业',
        'taxpayer_id' => '202003261233701778',
        'address' => '深圳市南山区深南大道10000号',
        'telephone' => '075512345678',
        'bank_name' => '测试银行',
        'bank_account' => '62001234567890',
      ],
      'seller_information' => [
        'name' => '深圳市南山区测试公司',
        'taxpayer_id' => '202003261233701778',
        'address' => '深圳市南山区深南大道10000号',
        'telephone' => '075512345678',
        'bank_name' => '测试银行',
        'bank_account' => '62001234567890',
      ],
      'extra_information' => [
        'payee' => '张三',
        'reviewer' => '李四',
        'drawer' => '王五',
      ],
      'items' => [[
        'tax_code' => '3010101020203000000',
        'goods_name' => '出租汽车客运服务',
        'specification' => 'A4',
        'unit' => '次',
        'quantity' => 100000000,
        'unit_price' => 380442000000,
        'amount' => 380442,
        'tax_amount' => 49458,
        'total_amount' => 429900,
        'tax_rate' => 1300,
        'tax_prefer_mark' => 'NO_FAVORABLE',
        'discount' => true,
      ],],
      'remark' => '备注',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance->chain('v3/taxi-invoice/cards')->postAsync([
  'json' => [
    'company_mchid' => '1900000109',
    'trade_number' => '10001071012021110600437180176110',
    'appid' => 'wxb1170446a4c0a5a2',
    'openid' => 'oUypO5aQ1oOCaSiNZUpT5kxxJHuc',
    'region_id' => 310100,
    'driver_license' => '6298416',
    'plate_number' => '浙AD12345',
    'fapiao_card_information' => [
      'fapiao_media_id' => 'ASNFZ4mrze/+3LqYdlQyEA==',
      'fapiao_number' => '12897794',
      'fapiao_code' => '044001911211',
      'fapiao_time' => '2020-07-01T12:00:00+08:00',
      'check_code' => '69001808340631374774',
      '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',
      'total_amount' => 382895,
      'tax_amount' => 44050,
      'amount' => 338845,
      'buyer_information' => [
        'type' => 'CORPORATION',
        'name' => '深圳市南山区测试企业',
        'taxpayer_id' => '202003261233701778',
        'address' => '深圳市南山区深南大道10000号',
        'telephone' => '075512345678',
        'bank_name' => '测试银行',
        'bank_account' => '62001234567890',
      ],
      'seller_information' => [
        'name' => '深圳市南山区测试公司',
        'taxpayer_id' => '202003261233701778',
        'address' => '深圳市南山区深南大道10000号',
        'telephone' => '075512345678',
        'bank_name' => '测试银行',
        'bank_account' => '62001234567890',
      ],
      'extra_information' => [
        'payee' => '张三',
        'reviewer' => '李四',
        'drawer' => '王五',
      ],
      'items' => [[
        'tax_code' => '3010101020203000000',
        'goods_name' => '出租汽车客运服务',
        'specification' => 'A4',
        'unit' => '次',
        'quantity' => 100000000,
        'unit_price' => 380442000000,
        'amount' => 380442,
        'tax_amount' => 49458,
        'total_amount' => 429900,
        'tax_rate' => 1300,
        'tax_prefer_mark' => 'NO_FAVORABLE',
        'discount' => true,
      ],],
      'remark' => '备注',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/taxi-invoice/cards']->postAsync([
  'json' => [
    'company_mchid' => '1900000109',
    'trade_number' => '10001071012021110600437180176110',
    'appid' => 'wxb1170446a4c0a5a2',
    'openid' => 'oUypO5aQ1oOCaSiNZUpT5kxxJHuc',
    'region_id' => 310100,
    'driver_license' => '6298416',
    'plate_number' => '浙AD12345',
    'fapiao_card_information' => [
      'fapiao_media_id' => 'ASNFZ4mrze/+3LqYdlQyEA==',
      'fapiao_number' => '12897794',
      'fapiao_code' => '044001911211',
      'fapiao_time' => '2020-07-01T12:00:00+08:00',
      'check_code' => '69001808340631374774',
      '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',
      'total_amount' => 382895,
      'tax_amount' => 44050,
      'amount' => 338845,
      'buyer_information' => [
        'type' => 'CORPORATION',
        'name' => '深圳市南山区测试企业',
        'taxpayer_id' => '202003261233701778',
        'address' => '深圳市南山区深南大道10000号',
        'telephone' => '075512345678',
        'bank_name' => '测试银行',
        'bank_account' => '62001234567890',
      ],
      'seller_information' => [
        'name' => '深圳市南山区测试公司',
        'taxpayer_id' => '202003261233701778',
        'address' => '深圳市南山区深南大道10000号',
        'telephone' => '075512345678',
        'bank_name' => '测试银行',
        'bank_account' => '62001234567890',
      ],
      'extra_information' => [
        'payee' => '张三',
        'reviewer' => '李四',
        'drawer' => '王五',
      ],
      'items' => [[
        'tax_code' => '3010101020203000000',
        'goods_name' => '出租汽车客运服务',
        'specification' => 'A4',
        'unit' => '次',
        'quantity' => 100000000,
        'unit_price' => 380442000000,
        'amount' => 380442,
        'tax_amount' => 49458,
        'total_amount' => 429900,
        'tax_rate' => 1300,
        'tax_prefer_mark' => 'NO_FAVORABLE',
        'discount' => true,
      ],],
      'remark' => '备注',
    ],
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->taxiInvoice->cards->post([
  'json' => [
    'company_mchid' => '1900000109',
    'trade_number' => '10001071012021110600437180176110',
    'appid' => 'wxb1170446a4c0a5a2',
    'openid' => 'oUypO5aQ1oOCaSiNZUpT5kxxJHuc',
    'region_id' => 310100,
    'driver_license' => '6298416',
    'plate_number' => '浙AD12345',
    'fapiao_card_information' => [
      'fapiao_media_id' => 'ASNFZ4mrze/+3LqYdlQyEA==',
      'fapiao_number' => '12897794',
      'fapiao_code' => '044001911211',
      'fapiao_time' => '2020-07-01T12:00:00+08:00',
      'check_code' => '69001808340631374774',
      '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',
      'total_amount' => 382895,
      'tax_amount' => 44050,
      'amount' => 338845,
      'buyer_information' => [
        'type' => 'CORPORATION',
        'name' => '深圳市南山区测试企业',
        'taxpayer_id' => '202003261233701778',
        'address' => '深圳市南山区深南大道10000号',
        'telephone' => '075512345678',
        'bank_name' => '测试银行',
        'bank_account' => '62001234567890',
      ],
      'seller_information' => [
        'name' => '深圳市南山区测试公司',
        'taxpayer_id' => '202003261233701778',
        'address' => '深圳市南山区深南大道10000号',
        'telephone' => '075512345678',
        'bank_name' => '测试银行',
        'bank_account' => '62001234567890',
      ],
      'extra_information' => [
        'payee' => '张三',
        'reviewer' => '李四',
        'drawer' => '王五',
      ],
      'items' => [[
        'tax_code' => '3010101020203000000',
        'goods_name' => '出租汽车客运服务',
        'specification' => 'A4',
        'unit' => '次',
        'quantity' => 100000000,
        'unit_price' => 380442000000,
        'amount' => 380442,
        'tax_amount' => 49458,
        'total_amount' => 429900,
        'tax_rate' => 1300,
        'tax_prefer_mark' => 'NO_FAVORABLE',
        'discount' => true,
      ],],
      'remark' => '备注',
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/taxi-invoice/cards')->post([
  'json' => [
    'company_mchid' => '1900000109',
    'trade_number' => '10001071012021110600437180176110',
    'appid' => 'wxb1170446a4c0a5a2',
    'openid' => 'oUypO5aQ1oOCaSiNZUpT5kxxJHuc',
    'region_id' => 310100,
    'driver_license' => '6298416',
    'plate_number' => '浙AD12345',
    'fapiao_card_information' => [
      'fapiao_media_id' => 'ASNFZ4mrze/+3LqYdlQyEA==',
      'fapiao_number' => '12897794',
      'fapiao_code' => '044001911211',
      'fapiao_time' => '2020-07-01T12:00:00+08:00',
      'check_code' => '69001808340631374774',
      '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',
      'total_amount' => 382895,
      'tax_amount' => 44050,
      'amount' => 338845,
      'buyer_information' => [
        'type' => 'CORPORATION',
        'name' => '深圳市南山区测试企业',
        'taxpayer_id' => '202003261233701778',
        'address' => '深圳市南山区深南大道10000号',
        'telephone' => '075512345678',
        'bank_name' => '测试银行',
        'bank_account' => '62001234567890',
      ],
      'seller_information' => [
        'name' => '深圳市南山区测试公司',
        'taxpayer_id' => '202003261233701778',
        'address' => '深圳市南山区深南大道10000号',
        'telephone' => '075512345678',
        'bank_name' => '测试银行',
        'bank_account' => '62001234567890',
      ],
      'extra_information' => [
        'payee' => '张三',
        'reviewer' => '李四',
        'drawer' => '王五',
      ],
      'items' => [[
        'tax_code' => '3010101020203000000',
        'goods_name' => '出租汽车客运服务',
        'specification' => 'A4',
        'unit' => '次',
        'quantity' => 100000000,
        'unit_price' => 380442000000,
        'amount' => 380442,
        'tax_amount' => 49458,
        'total_amount' => 429900,
        'tax_rate' => 1300,
        'tax_prefer_mark' => 'NO_FAVORABLE',
        'discount' => true,
      ],],
      'remark' => '备注',
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/taxi-invoice/cards']->post([
  'json' => [
    'company_mchid' => '1900000109',
    'trade_number' => '10001071012021110600437180176110',
    'appid' => 'wxb1170446a4c0a5a2',
    'openid' => 'oUypO5aQ1oOCaSiNZUpT5kxxJHuc',
    'region_id' => 310100,
    'driver_license' => '6298416',
    'plate_number' => '浙AD12345',
    'fapiao_card_information' => [
      'fapiao_media_id' => 'ASNFZ4mrze/+3LqYdlQyEA==',
      'fapiao_number' => '12897794',
      'fapiao_code' => '044001911211',
      'fapiao_time' => '2020-07-01T12:00:00+08:00',
      'check_code' => '69001808340631374774',
      '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',
      'total_amount' => 382895,
      'tax_amount' => 44050,
      'amount' => 338845,
      'buyer_information' => [
        'type' => 'CORPORATION',
        'name' => '深圳市南山区测试企业',
        'taxpayer_id' => '202003261233701778',
        'address' => '深圳市南山区深南大道10000号',
        'telephone' => '075512345678',
        'bank_name' => '测试银行',
        'bank_account' => '62001234567890',
      ],
      'seller_information' => [
        'name' => '深圳市南山区测试公司',
        'taxpayer_id' => '202003261233701778',
        'address' => '深圳市南山区深南大道10000号',
        'telephone' => '075512345678',
        'bank_name' => '测试银行',
        'bank_account' => '62001234567890',
      ],
      'extra_information' => [
        'payee' => '张三',
        'reviewer' => '李四',
        'drawer' => '王五',
      ],
      'items' => [[
        'tax_code' => '3010101020203000000',
        'goods_name' => '出租汽车客运服务',
        'specification' => 'A4',
        'unit' => '次',
        'quantity' => 100000000,
        'unit_price' => 380442000000,
        'amount' => 380442,
        'tax_amount' => 49458,
        'total_amount' => 429900,
        'tax_rate' => 1300,
        'tax_prefer_mark' => 'NO_FAVORABLE',
        'discount' => true,
      ],],
      'remark' => '备注',
    ],
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
card_appidstring插入用户卡包的公众号AppID
card_openidstring用户在插卡公众号下的OpenID
card_idstring出租车电子发票卡券模板ID
card_codestring出租车电子发票在卡包中的编码

参阅 官方文档

Published on the GitHub by TheNorthMemory