将电子发票插入微信用户卡包
商户自行开具电子发票后,可调用本接口将电子发票插入微信用户的卡包。
请求参数 | 类型 | 描述 |
---|---|---|
fapiao_apply_id | string | 发票申请单号 |
json | object | 声明请求的JSON 数据结构 |
sub_mchid | string | 子商户号 |
scene | string | 插卡场景 |
buyer_information | object | 购买方信息 |
type | string | 购买方类型 |
name | string | 名称 |
taxpayer_id | string | 纳税人识别号 |
address | string | 地址 |
telephone | string | 电话 |
bank_name | string | 开户银行 |
bank_account | string | 银行账号 |
phone | string | 手机号 |
string | 邮箱地址 | |
fapiao_card_information | object[] | 电子发票卡券信息列表 |
fapiao_media_id | string | 电子发票文件ID |
fapiao_number | string | 发票号码 |
fapiao_code | string | 发票代码 |
fapiao_time | string | 开票时间 |
check_code | string | 校验码 |
password | string | 密码 |
total_amount | integer | 总价税合计 |
tax_amount | integer | 总税额 |
amount | integer | 总金额 |
seller_information | object | 销售方信息 |
name | string | 名称 |
taxpayer_id | string | 纳税人识别号 |
address | string | 地址 |
telephone | string | 电话 |
bank_name | string | 开户银行 |
bank_account | string | 银行账号 |
extra_information | object | 附加信息 |
payee | string | 收款人 |
reviewer | string | 复核人 |
drawer | string | 开票人 |
items | object[] | 发票行信息 |
tax_code | string | 货物或应税劳务、服务编码 |
goods_name | string | 货物或应税劳务、服务名称 |
specification | string | 规格型号 |
unit | string | 单位 |
quantity | integer | 数量 |
unit_price | integer | 单价 |
amount | integer | 单行金额 |
tax_amount | integer | 单行税额 |
total_amount | integer | 单行金额合计 |
tax_rate | integer | 税率 |
tax_prefer_mark | string | 税收优惠政策标识 |
discount | boolean | 是否折扣行 |
remark | string | 备注信息 |
headers | object | 声明请求的头参数 |
Wechatpay-Serial | string | 平台公钥ID/平台公钥证书序列号 |
php
$instance->v3->newTaxControlFapiao->fapiaoApplications->_fapiao_apply_id_->insertCards->postAsync([
'fapiao_apply_id' => '4200000444201910177461284488',
'json' => [
'sub_mchid' => '1900000109',
'scene' => 'WITH_WECHATPAY',
'buyer_information' => [
'type' => 'ORGANIZATION',
'name' => '深圳市南山区测试企业',
'taxpayer_id' => '202003261233701778',
'address' => '深圳市南山区深南大道10000号',
'telephone' => '075512345678',
'bank_name' => '测试银行',
'bank_account' => '62001234567890',
'phone' => '18507550000',
'email' => '123110@qq.com',
],
'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,
'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' => '备注',
],],
],
'headers' => [
'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r($response->getStatusCode() === 202);
})
->wait();
php
$instance->chain('v3/new-tax-control-fapiao/fapiao-applications/{fapiao_apply_id}/insert-cards')->postAsync([
'fapiao_apply_id' => '4200000444201910177461284488',
'json' => [
'sub_mchid' => '1900000109',
'scene' => 'WITH_WECHATPAY',
'buyer_information' => [
'type' => 'ORGANIZATION',
'name' => '深圳市南山区测试企业',
'taxpayer_id' => '202003261233701778',
'address' => '深圳市南山区深南大道10000号',
'telephone' => '075512345678',
'bank_name' => '测试银行',
'bank_account' => '62001234567890',
'phone' => '18507550000',
'email' => '123110@qq.com',
],
'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,
'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' => '备注',
],],
],
'headers' => [
'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r($response->getStatusCode() === 202);
})
->wait();
php
$instance['v3/new-tax-control-fapiao/fapiao-applications/{fapiao_apply_id}/insert-cards']->postAsync([
'fapiao_apply_id' => '4200000444201910177461284488',
'json' => [
'sub_mchid' => '1900000109',
'scene' => 'WITH_WECHATPAY',
'buyer_information' => [
'type' => 'ORGANIZATION',
'name' => '深圳市南山区测试企业',
'taxpayer_id' => '202003261233701778',
'address' => '深圳市南山区深南大道10000号',
'telephone' => '075512345678',
'bank_name' => '测试银行',
'bank_account' => '62001234567890',
'phone' => '18507550000',
'email' => '123110@qq.com',
],
'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,
'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' => '备注',
],],
],
'headers' => [
'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r($response->getStatusCode() === 202);
})
->wait();
php
$response = $instance->v3->newTaxControlFapiao->fapiaoApplications->_fapiao_apply_id_->insertCards->post([
'fapiao_apply_id' => '4200000444201910177461284488',
'json' => [
'sub_mchid' => '1900000109',
'scene' => 'WITH_WECHATPAY',
'buyer_information' => [
'type' => 'ORGANIZATION',
'name' => '深圳市南山区测试企业',
'taxpayer_id' => '202003261233701778',
'address' => '深圳市南山区深南大道10000号',
'telephone' => '075512345678',
'bank_name' => '测试银行',
'bank_account' => '62001234567890',
'phone' => '18507550000',
'email' => '123110@qq.com',
],
'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,
'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' => '备注',
],],
],
'headers' => [
'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
],
]);
print_r($response->getStatusCode() === 202);
php
$response = $instance->chain('v3/new-tax-control-fapiao/fapiao-applications/{fapiao_apply_id}/insert-cards')->post([
'fapiao_apply_id' => '4200000444201910177461284488',
'json' => [
'sub_mchid' => '1900000109',
'scene' => 'WITH_WECHATPAY',
'buyer_information' => [
'type' => 'ORGANIZATION',
'name' => '深圳市南山区测试企业',
'taxpayer_id' => '202003261233701778',
'address' => '深圳市南山区深南大道10000号',
'telephone' => '075512345678',
'bank_name' => '测试银行',
'bank_account' => '62001234567890',
'phone' => '18507550000',
'email' => '123110@qq.com',
],
'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,
'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' => '备注',
],],
],
'headers' => [
'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
],
]);
print_r($response->getStatusCode() === 202);
php
$response = $instance['v3/new-tax-control-fapiao/fapiao-applications/{fapiao_apply_id}/insert-cards']->post([
'fapiao_apply_id' => '4200000444201910177461284488',
'json' => [
'sub_mchid' => '1900000109',
'scene' => 'WITH_WECHATPAY',
'buyer_information' => [
'type' => 'ORGANIZATION',
'name' => '深圳市南山区测试企业',
'taxpayer_id' => '202003261233701778',
'address' => '深圳市南山区深南大道10000号',
'telephone' => '075512345678',
'bank_name' => '测试银行',
'bank_account' => '62001234567890',
'phone' => '18507550000',
'email' => '123110@qq.com',
],
'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,
'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' => '备注',
],],
],
'headers' => [
'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
],
]);
print_r($response->getStatusCode() === 202);
返回字典 | 类型 | 描述 |
---|
参阅 官方文档