查询电子发票
商户调用【开具电子发票】接口或【冲红电子发票】接口或【将电子发票插入微信用户卡包】接口成功后,应调用本接口查询电子发票开具/冲红/插卡结果,并获取已开具/冲红/插卡的电子发票信息。
| 请求参数 | 类型 | 描述 |
|---|---|---|
| fapiao_apply_id | string | 发票申请单号 |
| query | object | 声明请求的查询参数 |
| sub_mchid | string | 子商户号 |
| fapiao_id | string | 商户发票单号 |
php
$instance->v3->newTaxControlFapiao->fapiaoApplications->_fapiao_apply_id_->getAsync([
'fapiao_apply_id' => '4200000444201910177461284488',
'query' => [
'sub_mchid' => '1900000109',
'fapiao_id' => '20200701123456',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$instance->chain('v3/new-tax-control-fapiao/fapiao-applications/{fapiao_apply_id}')->getAsync([
'fapiao_apply_id' => '4200000444201910177461284488',
'query' => [
'sub_mchid' => '1900000109',
'fapiao_id' => '20200701123456',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$instance['v3/new-tax-control-fapiao/fapiao-applications/{fapiao_apply_id}']->getAsync([
'fapiao_apply_id' => '4200000444201910177461284488',
'query' => [
'sub_mchid' => '1900000109',
'fapiao_id' => '20200701123456',
],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
print_r(json_decode((string) $response->getBody(), true));
})
->wait();php
$response = $instance->v3->newTaxControlFapiao->fapiaoApplications->_fapiao_apply_id_->get([
'fapiao_apply_id' => '4200000444201910177461284488',
'query' => [
'sub_mchid' => '1900000109',
'fapiao_id' => '20200701123456',
],
]);
print_r(json_decode((string) $response->getBody(), true));php
$response = $instance->chain('v3/new-tax-control-fapiao/fapiao-applications/{fapiao_apply_id}')->get([
'fapiao_apply_id' => '4200000444201910177461284488',
'query' => [
'sub_mchid' => '1900000109',
'fapiao_id' => '20200701123456',
],
]);
print_r(json_decode((string) $response->getBody(), true));php
$response = $instance['v3/new-tax-control-fapiao/fapiao-applications/{fapiao_apply_id}']->get([
'fapiao_apply_id' => '4200000444201910177461284488',
'query' => [
'sub_mchid' => '1900000109',
'fapiao_id' => '20200701123456',
],
]);
print_r(json_decode((string) $response->getBody(), true));| 返回字典 | 类型 | 描述 |
|---|---|---|
| total_count | integer | 发票数量 |
| fapiao_information | object[] | 发票信息 |
| fapiao_id | string | 商户发票单号 |
| status | string | 发票状态ISSUE_ACCEPTED | ISSUED | REVERSE_ACCEPTED | REVERSED | ISSUE_FAILED | REVERSE_FAILED 枚举值之一 |
| blue_fapiao | object | 蓝字发票信息 |
| fapiao_code | string | 发票代码 |
| fapiao_number | string | 发票号码 |
| check_code | string | 校验码 |
| password | string | 密码 |
| fapiao_time | string | 开票时间 |
| red_fapiao | object | 红字发票信息 |
| fapiao_code | string | 发票代码 |
| fapiao_number | string | 发票号码 |
| check_code | string | 校验码 |
| password | string | 密码 |
| fapiao_time | string | 开票时间 |
| card_information | object | 电子发票插卡信息 |
| card_appid | string | 插卡公众号AppID |
| card_openid | string | 用户在插卡公众号下的OpenID |
| card_id | string | 电子发票卡券模板ID |
| card_code | string | 电子发票在卡包中的编码 |
| card_status | string | 发票卡券状态INSERT_ACCEPTED | INSERTED | DISCARD_ACCEPTED | DISCARDED 枚举值之一 |
| 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 | 银行账号 |
| buyer_information | object | 购买方信息 |
| type | string | 购买方类型INDIVIDUAL | ORGANIZATION 枚举值之一 |
| name | string | 名称 |
| taxpayer_id | string | 纳税人识别号 |
| address | string | 地址 |
| telephone | string | 电话 |
| bank_name | string | 开户银行 |
| bank_account | string | 银行账号 |
| phone | string | 手机号 |
| string | 邮箱地址 | |
| amount | integer | 订单金额 |
| out_trade_no | string | 商户订单号 |
| fapiao_bill_type | string | 开具的发票类型COMM_FAPIAO | VAT_FAPIAO 枚举值之一 |
| user_apply_message | 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 | 税收优惠政策标识NO_FAVORABLE | OUTSIDE_VAT | VAT_EXEMPT | NORMAL_ZERO_RATED | EXPORT_ZERO_RATED 枚举值之一 |
| discount | boolean | 是否折扣行 |
| remark | string | 备注信息 |
| fapiao_error_code | string | 开票失败错误码 |
| fapiao_error_message | string | 开票失败原因 |