开具电子发票 商户完成收款后,调用本接口开具电子发票并插入微信用户的卡包。若是非微信支付场景,需要先通过【获取抬头填写链接】接口获取抬头填写链接,并等待用户完成填写才能调用本接口;若是微信支付场景,则无需额外获取抬头填写链接。
请求参数类型描述jsonobject声明请求的JSON数据结构sub_mchidstring子商户号scenestring开票场景fapiao_apply_idstring发票申请单号buyer_informationobject购买方信息typestring购买方类型namestring名称taxpayer_idstring纳税人识别号addressstring地址telephonestring电话bank_namestring开户银行bank_accountstring银行账号phonestring手机号emailstring邮箱地址fapiao_informationobject[]需要开具的发票信息fapiao_idstring商户发票单号total_amountinteger总价税合计need_listboolean是否以清单形式开具发票remarkstring发票备注itemsobject[]发票行信息tax_codestring税局侧规定的货物或应税劳务、服务税收分类编码goods_categorystring税局侧规定的货物或应税劳务、服务分类名称goods_namestring货物或应税劳务、服务名称goods_idnumber企业侧维护的货物或应税劳务、服务编码specificationstring规格型号unitstring单位quantityinteger数量total_amountinteger单行金额合计tax_ratenumber税率tax_prefer_markstring税收优惠政策标识discountboolean是否折扣行headersobject声明请求的头参数Wechatpay-Serialstring微信支付公钥ID/平台证书序列号异步纯链式异步声明式异步属性式同步纯链式同步声明式同步属性式php$instance->v3->newTaxControlFapiao->fapiaoApplications->postAsync([
'json' => [
'sub_mchid' => '1900000109',
'scene' => 'WITH_WECHATPAY',
'fapiao_apply_id' => '4200000444201910177461284488',
'buyer_information' => [
'type' => 'ORGANIZATION',
'name' => '深圳市南山区测试企业',
'taxpayer_id' => '202003261233701778',
'address' => '深圳市南山区深南大道10000号',
'telephone' => '075512345678',
'bank_name' => '测试银行',
'bank_account' => '62001234567890',
'phone' => 'pVd1HJ6zyvPedzGaV+X3qtmrq9bb9tPttdY+aQ6zB',
'email' => 'pVd1HJ6zyvPedzGaV+X3qtmrq9bb9tPttdY+aQ6zB',
],
'fapiao_information' => [[
'fapiao_id' => '20200701123456',
'total_amount' => 382895,
'need_list' => true,
'remark' => '备注',
'items' => [[
'tax_code' => '3010101020203000000',
'goods_category' => '运输服务',
'goods_name' => '出租汽车客运服务',
'goods_id' => 1,
'specification' => 'A4',
'unit' => '次',
'quantity' => 100000000,
'total_amount' => 429900,
'tax_rate' => 1300,
'tax_prefer_mark' => 'NO_FAVORABLE',
'discount' => true,
],],
],],
],
'headers' => [
'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r($response->getStatusCode() === 202);
})
->wait();1234567891011121314151617181920212223242526272829303132333435363738394041424344php$instance->chain('v3/new-tax-control-fapiao/fapiao-applications')->postAsync([
'json' => [
'sub_mchid' => '1900000109',
'scene' => 'WITH_WECHATPAY',
'fapiao_apply_id' => '4200000444201910177461284488',
'buyer_information' => [
'type' => 'ORGANIZATION',
'name' => '深圳市南山区测试企业',
'taxpayer_id' => '202003261233701778',
'address' => '深圳市南山区深南大道10000号',
'telephone' => '075512345678',
'bank_name' => '测试银行',
'bank_account' => '62001234567890',
'phone' => 'pVd1HJ6zyvPedzGaV+X3qtmrq9bb9tPttdY+aQ6zB',
'email' => 'pVd1HJ6zyvPedzGaV+X3qtmrq9bb9tPttdY+aQ6zB',
],
'fapiao_information' => [[
'fapiao_id' => '20200701123456',
'total_amount' => 382895,
'need_list' => true,
'remark' => '备注',
'items' => [[
'tax_code' => '3010101020203000000',
'goods_category' => '运输服务',
'goods_name' => '出租汽车客运服务',
'goods_id' => 1,
'specification' => 'A4',
'unit' => '次',
'quantity' => 100000000,
'total_amount' => 429900,
'tax_rate' => 1300,
'tax_prefer_mark' => 'NO_FAVORABLE',
'discount' => true,
],],
],],
],
'headers' => [
'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r($response->getStatusCode() === 202);
})
->wait();1234567891011121314151617181920212223242526272829303132333435363738394041424344php$instance['v3/new-tax-control-fapiao/fapiao-applications']->postAsync([
'json' => [
'sub_mchid' => '1900000109',
'scene' => 'WITH_WECHATPAY',
'fapiao_apply_id' => '4200000444201910177461284488',
'buyer_information' => [
'type' => 'ORGANIZATION',
'name' => '深圳市南山区测试企业',
'taxpayer_id' => '202003261233701778',
'address' => '深圳市南山区深南大道10000号',
'telephone' => '075512345678',
'bank_name' => '测试银行',
'bank_account' => '62001234567890',
'phone' => 'pVd1HJ6zyvPedzGaV+X3qtmrq9bb9tPttdY+aQ6zB',
'email' => 'pVd1HJ6zyvPedzGaV+X3qtmrq9bb9tPttdY+aQ6zB',
],
'fapiao_information' => [[
'fapiao_id' => '20200701123456',
'total_amount' => 382895,
'need_list' => true,
'remark' => '备注',
'items' => [[
'tax_code' => '3010101020203000000',
'goods_category' => '运输服务',
'goods_name' => '出租汽车客运服务',
'goods_id' => 1,
'specification' => 'A4',
'unit' => '次',
'quantity' => 100000000,
'total_amount' => 429900,
'tax_rate' => 1300,
'tax_prefer_mark' => 'NO_FAVORABLE',
'discount' => true,
],],
],],
],
'headers' => [
'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r($response->getStatusCode() === 202);
})
->wait();1234567891011121314151617181920212223242526272829303132333435363738394041424344php$response = $instance->v3->newTaxControlFapiao->fapiaoApplications->post([
'json' => [
'sub_mchid' => '1900000109',
'scene' => 'WITH_WECHATPAY',
'fapiao_apply_id' => '4200000444201910177461284488',
'buyer_information' => [
'type' => 'ORGANIZATION',
'name' => '深圳市南山区测试企业',
'taxpayer_id' => '202003261233701778',
'address' => '深圳市南山区深南大道10000号',
'telephone' => '075512345678',
'bank_name' => '测试银行',
'bank_account' => '62001234567890',
'phone' => 'pVd1HJ6zyvPedzGaV+X3qtmrq9bb9tPttdY+aQ6zB',
'email' => 'pVd1HJ6zyvPedzGaV+X3qtmrq9bb9tPttdY+aQ6zB',
],
'fapiao_information' => [[
'fapiao_id' => '20200701123456',
'total_amount' => 382895,
'need_list' => true,
'remark' => '备注',
'items' => [[
'tax_code' => '3010101020203000000',
'goods_category' => '运输服务',
'goods_name' => '出租汽车客运服务',
'goods_id' => 1,
'specification' => 'A4',
'unit' => '次',
'quantity' => 100000000,
'total_amount' => 429900,
'tax_rate' => 1300,
'tax_prefer_mark' => 'NO_FAVORABLE',
'discount' => true,
],],
],],
],
'headers' => [
'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
],
]);
print_r($response->getStatusCode() === 202);1234567891011121314151617181920212223242526272829303132333435363738394041php$response = $instance->chain('v3/new-tax-control-fapiao/fapiao-applications')->post([
'json' => [
'sub_mchid' => '1900000109',
'scene' => 'WITH_WECHATPAY',
'fapiao_apply_id' => '4200000444201910177461284488',
'buyer_information' => [
'type' => 'ORGANIZATION',
'name' => '深圳市南山区测试企业',
'taxpayer_id' => '202003261233701778',
'address' => '深圳市南山区深南大道10000号',
'telephone' => '075512345678',
'bank_name' => '测试银行',
'bank_account' => '62001234567890',
'phone' => 'pVd1HJ6zyvPedzGaV+X3qtmrq9bb9tPttdY+aQ6zB',
'email' => 'pVd1HJ6zyvPedzGaV+X3qtmrq9bb9tPttdY+aQ6zB',
],
'fapiao_information' => [[
'fapiao_id' => '20200701123456',
'total_amount' => 382895,
'need_list' => true,
'remark' => '备注',
'items' => [[
'tax_code' => '3010101020203000000',
'goods_category' => '运输服务',
'goods_name' => '出租汽车客运服务',
'goods_id' => 1,
'specification' => 'A4',
'unit' => '次',
'quantity' => 100000000,
'total_amount' => 429900,
'tax_rate' => 1300,
'tax_prefer_mark' => 'NO_FAVORABLE',
'discount' => true,
],],
],],
],
'headers' => [
'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
],
]);
print_r($response->getStatusCode() === 202);1234567891011121314151617181920212223242526272829303132333435363738394041php$response = $instance['v3/new-tax-control-fapiao/fapiao-applications']->post([
'json' => [
'sub_mchid' => '1900000109',
'scene' => 'WITH_WECHATPAY',
'fapiao_apply_id' => '4200000444201910177461284488',
'buyer_information' => [
'type' => 'ORGANIZATION',
'name' => '深圳市南山区测试企业',
'taxpayer_id' => '202003261233701778',
'address' => '深圳市南山区深南大道10000号',
'telephone' => '075512345678',
'bank_name' => '测试银行',
'bank_account' => '62001234567890',
'phone' => 'pVd1HJ6zyvPedzGaV+X3qtmrq9bb9tPttdY+aQ6zB',
'email' => 'pVd1HJ6zyvPedzGaV+X3qtmrq9bb9tPttdY+aQ6zB',
],
'fapiao_information' => [[
'fapiao_id' => '20200701123456',
'total_amount' => 382895,
'need_list' => true,
'remark' => '备注',
'items' => [[
'tax_code' => '3010101020203000000',
'goods_category' => '运输服务',
'goods_name' => '出租汽车客运服务',
'goods_id' => 1,
'specification' => 'A4',
'unit' => '次',
'quantity' => 100000000,
'total_amount' => 429900,
'tax_rate' => 1300,
'tax_prefer_mark' => 'NO_FAVORABLE',
'discount' => true,
],],
],],
],
'headers' => [
'Wechatpay-Serial' => 'PUB_KEY_ID_0114232134912410000000000000',
],
]);
print_r($response->getStatusCode() === 202);1234567891011121314151617181920212223242526272829303132333435363738394041返回字典类型描述空字符串(无返回内容)参阅 官方文档 官方文档