Skip to content

查询电子发票

商户调用【开具电子发票】接口或【冲红电子发票】接口或【将电子发票插入微信用户卡包】接口成功后,应调用本接口查询电子发票开具/冲红/插卡结果,并获取已开具/冲红/插卡的电子发票信息。

请求参数类型描述
fapiao_apply_idstring发票申请单号
queryobject声明请求的查询参数
sub_mchidstring子商户号
fapiao_idstring商户发票单号
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_countinteger发票数量
fapiao_informationobject[]发票信息
fapiao_idstring商户发票单号
statusstring发票状态
blue_fapiaoobject蓝字发票信息
fapiao_codestring发票代码
fapiao_numberstring发票号码
check_codestring校验码
passwordstring密码
fapiao_timestring开票时间
red_fapiaoobject红字发票信息
fapiao_codestring发票代码
fapiao_numberstring发票号码
check_codestring校验码
passwordstring密码
fapiao_timestring开票时间
card_informationobject电子发票插卡信息
card_appidstring插卡公众号AppID
card_openidstring用户在插卡公众号下的OpenID
card_idstring电子发票卡券模板ID
card_codestring电子发票在卡包中的编码
card_statusstring发票卡券状态
total_amountinteger总价税合计
tax_amountinteger总税额
amountinteger总金额
seller_informationobject销售方信息
namestring名称
taxpayer_idstring纳税人识别号
addressstring地址
telephonestring电话
bank_namestring开户银行
bank_accountstring银行账号
buyer_informationobject购买方信息
typestring购买方类型
namestring名称
taxpayer_idstring纳税人识别号
addressstring地址
telephonestring电话
bank_namestring开户银行
bank_accountstring银行账号
phonestring手机号
emailstring邮箱地址
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备注信息

参阅 官方文档

Published on the GitHub by TheNorthMemory