Skip to content

获取抬头填写链接

非微信支付场景中,商户需先调用本接口获取抬头填写链接,供用户填写发票抬头。当用户提交抬头信息后,微信支付会根据商户配置的回调地址进行回调通知。 注意:获取到的抬头填写链接有30分钟的有效期,若在用户填写发票抬头之前链接过期,商户需要重新获取(此时无需更换发票申请单号)

请求参数类型描述
queryobject声明请求的查询参数
sub_mchidstring子商户号
fapiao_apply_idstring发票申请单号
sourcestring开票来源
appidstring商户AppID
openidstring用户OpenID
total_amountinteger总金额
seller_namestring销售方名称
show_phone_cellboolean是否需要展示手机号填写栏
must_input_phoneboolean用户是否必须填写手机号
show_email_cellboolean是否需要展示邮箱地址填写栏
must_input_emailboolean用户是否必须填写邮箱地址
php
$instance->v3->newTaxControlFapiao->userTitle->titleUrl->getAsync([
  'query' => [
    'sub_mchid' => '1900000109',
    'fapiao_apply_id' => 'fapiao_20200701_123456',
    'source' => 'WEB',
    'appid' => 'wxb1170446a4c0a5a2',
    'openid' => 'plN5twRbHym_j-QcqCzstl0HmwEs',
    'total_amount' => 382895,
    'seller_name' => '深圳市南山区测试商户',
    'show_phone_cell' => true,
    'must_input_phone' => true,
    'show_email_cell' => true,
    'must_input_email' => true,
  ],
])
->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/user-title/title-url')->getAsync([
  'query' => [
    'sub_mchid' => '1900000109',
    'fapiao_apply_id' => 'fapiao_20200701_123456',
    'source' => 'WEB',
    'appid' => 'wxb1170446a4c0a5a2',
    'openid' => 'plN5twRbHym_j-QcqCzstl0HmwEs',
    'total_amount' => 382895,
    'seller_name' => '深圳市南山区测试商户',
    'show_phone_cell' => true,
    'must_input_phone' => true,
    'show_email_cell' => true,
    'must_input_email' => true,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$instance['v3/new-tax-control-fapiao/user-title/title-url']->getAsync([
  'query' => [
    'sub_mchid' => '1900000109',
    'fapiao_apply_id' => 'fapiao_20200701_123456',
    'source' => 'WEB',
    'appid' => 'wxb1170446a4c0a5a2',
    'openid' => 'plN5twRbHym_j-QcqCzstl0HmwEs',
    'total_amount' => 382895,
    'seller_name' => '深圳市南山区测试商户',
    'show_phone_cell' => true,
    'must_input_phone' => true,
    'show_email_cell' => true,
    'must_input_email' => true,
  ],
])
->then(static function(\Psr\Http\Message\ResponseInterface $response) {
  print_r(json_decode((string) $response->getBody(), true));
})
->wait();
php
$response = $instance->v3->newTaxControlFapiao->userTitle->titleUrl->get([
  'query' => [
    'sub_mchid' => '1900000109',
    'fapiao_apply_id' => 'fapiao_20200701_123456',
    'source' => 'WEB',
    'appid' => 'wxb1170446a4c0a5a2',
    'openid' => 'plN5twRbHym_j-QcqCzstl0HmwEs',
    'total_amount' => 382895,
    'seller_name' => '深圳市南山区测试商户',
    'show_phone_cell' => true,
    'must_input_phone' => true,
    'show_email_cell' => true,
    'must_input_email' => true,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance->chain('v3/new-tax-control-fapiao/user-title/title-url')->get([
  'query' => [
    'sub_mchid' => '1900000109',
    'fapiao_apply_id' => 'fapiao_20200701_123456',
    'source' => 'WEB',
    'appid' => 'wxb1170446a4c0a5a2',
    'openid' => 'plN5twRbHym_j-QcqCzstl0HmwEs',
    'total_amount' => 382895,
    'seller_name' => '深圳市南山区测试商户',
    'show_phone_cell' => true,
    'must_input_phone' => true,
    'show_email_cell' => true,
    'must_input_email' => true,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
php
$response = $instance['v3/new-tax-control-fapiao/user-title/title-url']->get([
  'query' => [
    'sub_mchid' => '1900000109',
    'fapiao_apply_id' => 'fapiao_20200701_123456',
    'source' => 'WEB',
    'appid' => 'wxb1170446a4c0a5a2',
    'openid' => 'plN5twRbHym_j-QcqCzstl0HmwEs',
    'total_amount' => 382895,
    'seller_name' => '深圳市南山区测试商户',
    'show_phone_cell' => true,
    'must_input_phone' => true,
    'show_email_cell' => true,
    'must_input_email' => true,
  ],
]);
print_r(json_decode((string) $response->getBody(), true));
返回字典类型描述
title_urlstring抬头填写链接
miniprogram_appidstring抬头填写小程序AppID
miniprogram_pathstring抬头填写小程序页面路径
miniprogram_user_namestring抬头填写小程序的用户名

参阅 官方文档

Published on the GitHub by TheNorthMemory