String url = "https://api.weixin.qq.com/card/invoice/platform/createcard?access_token=" + token; Map jsono = new HashMap(); Map invoice_info = new HashMap(); invoice_info.put( "type" , "增值税普通发票" ); invoice_info.put( "payee" , "内蒙古鑫泰集团突泉县鑫光热力有限责任公司" ); Map base_info = new HashMap(); String logo_url = "http://mmbiz.qpic.cn/mmbiz/iaL1LJM1mF9aRKPZJkmG8xXhiaHqkKSVMMWeN3hLut7X7hicFNjakmxibMLGWpXrEXB33367o7zHN0CwngnQY7zb7g/0" ; System.out.println(logo_url); base_info.put( "logo_url" , logo_url); base_info.put( "title" , "鑫光热力公司" ); base_info.put( "custom_url_name" , "xyz" ); base_info.put( "custom_url" , "xyz" ); base_info.put( "custom_url_sub_title" , "xyz" ); base_info.put( "promotion_url_name" , "puname" ); base_info.put( "promotion_url" , "purl" ); base_info.put( "promotion_url_sub_title" , "ptitle" ); invoice_info.put( "base_info" , base_info); jsono.put( "invoice_info" , invoice_info); String param = JSON.toJSONString(jsono); System.out.println(param); String sendPost = HttpRequestUtils.sendPost(url, param); |
post数据 :{“invoice_info”:{“payee”:“内蒙古鑫泰集团突泉县鑫光热力有限责任公司”,“base_info”:{“logo_url”:“http:\/\/mmbiz.qpic.cn\/mmbiz\/iaL1LJM1mF9aRKPZJkmG8xXhiaHqkKSVMMWeN3hLut7X7hicFNjakmxibMLGWpXrEXB33367o7zHN0CwngnQY7zb7g\/0”,“custom_url_name”:“xyz”,“promotion_url_sub_title”:“ptitle”,“promotion_url_name”:“puname”,“promotion_url”:“purl”,“custom_url_sub_title”:“xyz”,“title”:“鑫光热力公司”,“custom_url”:“xyz”},“type”:“增值税普通发票”}}
返回错误 {“errcode”:47001,“errmsg”:“data format error hint: [fxhlJa09989034]”}
使用下面这个接口
https://image.wxopen.club/content_76ddfb86-3827-11ea-9813-001a7dda7111.png