ISV自有页面

DEMO示例

请打开支付宝扫描下方二维码观看示例:

image.png

说明:以上页面都有商户自行开发或者由服务商代理开发。

流程图

image.png

说明:
1、消费者使用支付宝扫描交易小票上的开票二维码;
2、跳转到机构的开票页面用户选择发票抬头;发票抬头列表由机构调支付发票抬头输出组件获取;
3、用户提交开票请求;
4、机构开票完成,同步发票信息到支付宝发票管家;
5、在支付宝发票管家查看发票。

接口说明

1.用户授权

具体实现请参考下方链接:
https://docs.open.alipay.com/289/105656

2.商家批量入驻申请

alipay.ebpp.invoice.merchantlist.enter.apply

请求参数

AlipayClient alipayClient = new DefaultAlipayClient("
https://openapi.alipay.com/gateway.do
","app_id","your private_key","json","GBK","alipay_public_key","RSA2");
AlipayEbppInvoiceMerchantlistEnterApplyRequest request = new AlipayEbppInvoiceMerchantlistEnterApplyRequest();
request.setBizContent("{" +
"\"merchant_base\":{" +
"\"m_short_name\":\"MYJF\"," +
"\"m_name\":\"蚂蚁金融服务集团\"," +
"\"logo_info\":\"/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAA...\"" +
"    }," +
"      \"sub_merchant_list\":[{" +
"        \"sub_m_short_name\":\"MYJF_HZ\"," +
"\"sub_m_name\":\"杭州蚂蚁金服信息技术有限公司\"," +
"\"register_no\":\"91500000747150346A\"" +
"        }]," +
"\"sub_merchant_common_info\":{" +
"\"product_code\":\"QRCODE_MERCHANT_OPEN\"," +
"\"s_short_name\":\"SAD\"" +
"    }" +
"  }");
AlipayEbppInvoiceMerchantlistEnterApplyResponse response = alipayClient.execute(request);
if(response.isSuccess()){
System.out.println("调用成功");
} else {
System.out.println("调用失败");
}

JSON响应示例

{
"alipay_ebpp_invoice_merchantlist_enter_apply_response":{
    "code":"10000",
    "msg":"Success"
  }
,"sign":"ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE"
}

3.发票信息发送接口调用

场景说明:
该接口调用的前提是该商家已经在支付宝端调用【商家批量入驻接口-alipay.ebpp.invoice.merchantlist.enter.apply】完成了入驻。商家系统为消费者开具的发票可以通过该接口发送至支付宝端,之后消费者便可以在支付宝端查看该发票信息或者下载发票pdf文件。

发票信息发送:alipay.ebpp.invoice.info.sendSDK调用示例(以JAVA为例,更多语言示例参见接口文档)

AlipayClient alipayClient = new DefaultAlipayClient("
https://openapi.alipay.com/gateway.do
","app_id","your private_key","json","GBK","alipay_public_key","RSA2");
AlipayEbppInvoiceInfoSendRequest request = new AlipayEbppInvoiceInfoSendRequest();
request.setBizContent("{" +
"\"m_short_name\":\"XSD\"," +
"\"sub_m_short_name\":\"XSD_HL\"," +
"      \"invoice_info_list\":[{" +
"        \"user_id\":\"2088399922382233\"," +
"\"invoice_code\":\"4112740003\"," +
"\"invoice_no\":\"41791003\"," +
"\"invoice_date\":\"2017-10-10\"," +
"\"sum_amount\":\"101.00\"," +
"\"ex_tax_amount\":\"100.00\"," +
"\"tax_amount\":\"1.00\"," +
"          \"invoice_content\":[{" +
"            \"item_name\":\"餐饮费\"," +
"\"item_no\":\"1010101990000000000\"," +
"\"item_spec\":\"G39\"," +
"\"item_unit\":\"台\"," +
"\"item_quantity\":1," +
"\"item_unit_price\":\"100.00\"," +
"\"item_ex_tax_amount\":\"100.00\"," +
"\"item_tax_rate\":\"0.01\"," +
"\"item_tax_amount\":\"1.00\"," +
"\"item_sum_amount\":\"101.00\"," +
"\"row_type\":\"0\"" +
"            }]," +
"\"out_trade_no\":\"20171023293456785924325\"," +
"\"invoice_type\":\"BLUE\"," +
"\"invoice_kind\":\"PLAIN\"," +
"\"invoice_title\":{" +
"\"title_name\":\"支付宝(中国)网络技术有限公司\"," +
"\"payer_register_no\":\"9133010060913454XP\"," +
"\"payer_address_tel\":\"杭州市西湖区天目山路黄龙时代广场0571-11111111\"," +
"\"payer_bank_name_account\":\"中国建设银行11111111\"" +
"        }," +
"\"payee_register_no\":\"310101000000090\"," +
"\"payee_register_name\":\"支付宝(杭州)信息技术有限公司\"," +
"\"payee_address_tel\":\"杭州市西湖区某某办公楼 0571-237405862\"," +
"\"payee_bank_name_account\":\"西湖区建行11111111111\"," +
"\"check_code\":\"15170246985745164986\"," +
"\"out_invoice_id\":\"201710283459661232435535\"," +
"\"ori_blue_inv_code\":\"4112740002\"," +
"\"ori_blue_inv_no\":\"41791002\"," +
"\"file_download_type\":\"PDF\"," +
"\"file_download_url\":\"
http://img.hadalo.com/aa/kq/ddhrtdefgxKVXXXXa6apXXXXXXXXXX.pdf
\"," +
"\"payee\":\"张三\"," +
"\"checker\":\"李四\"," +
"\"clerk\":\"赵吴\"," +
"\"invoice_memo\":\"订单号:2017120800001\"," +
"\"extend_fields\":\"m_invoice_detail_url=
http://196.021.871.011:8080/invoice/detail.action?fpdm=
 4112740003&fphm=41791003\"" +
"        }]" +
"  }");
AlipayEbppInvoiceInfoSendResponse response = alipayClient.execute(request);
if(response.isSuccess()){
System.out.println("调用成功");
} else {
System.out.println("调用失败");
}

JSON响应示例

{
"alipay_ebpp_invoice_info_send_response":{
    "code":"10000",
    "msg":"Success",
"url":"
alipays://platformapi/startapp?appId=20000920&url=%2Fwww%2Flist.htm%3Ffrom%3Doffline
"
  }
,"sign":"ERITJKEIJKJHKKKKKKKHJEREEEEEEEEEEE"
}
onlineServer