企业打款核验
请求Header:
| 名称 | 值 | |
|---|---|---|
| Content-Type | application/x-www-form-urlencoded |
请求参数说明:
| 名称 | 必填 | 类型 | 说明 | |
|---|---|---|---|---|
| key | 是 | string | 在个人中心->我的数据,接口名称上方查看 | |
| codeType | 是 | string | 企业代码类型,1:统一信用代码 2:工商注册号 | |
| code | 是 | string | 企业代码类型为 1 时,输入统一信用代码,企业代码类型为 2时,输入工商注册号 | |
| companyName | 是 | string | 企业名称 | |
| personName | 是 | string | 法人名称 | |
| accountNo | 是 | string | 企业对公账户账号 | |
| accountBank | 是 | string | 企业对公账户开户银行名称(总行即可,无需具体到支行) | |
| accountProv | 否 | string | 企业开户行所在省 | |
| accountCity | 否 | string | 企业开户行所在地 区 | |
| subBank | 否 | string | 电子联行号 |
请求代码示例:
curl -k -i "https://apis.juhe.cn/enterprise_payment/query?key=key&codeType=xxx&code=xxx&companyName=xxx&personName=xxx&accountNo=xxx&accountBank=xxx&accountProv=&accountCity=&subBank="
<?php
/**
* 1734-企业打款核验 - 代码参考(根据实际业务情况修改)
*/
// 基本参数配置
$apiUrl = "https://apis.juhe.cn/enterprise_payment/query"; // 接口请求URL
$method = "GET"; // 接口请求方式
$headers = ["Content-Type: application/x-www-form-urlencoded"]; // 接口请求header
$apiKey = "您申请的调用APIkey"; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
$requestParams = [
'key' => $apiKey,
'codeType'=> 'xxx',
'code'=> 'xxx',
'companyName'=> 'xxx',
'personName'=> 'xxx',
'accountNo'=> 'xxx',
'accountBank'=> 'xxx',
'accountProv'=> '',
'accountCity'=> '',
'subBank'=> '',
];
$requestParamsStr = http_build_query($requestParams);
// 发起接口网络请求
$curl = curl_init();
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method);
curl_setopt($curl, CURLOPT_URL, $apiUrl . '?' . $requestParamsStr);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_FAILONERROR, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
if (1 == strpos("$" . $apiUrl, "https://")) {
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
}
$response = curl_exec($curl);
$httpInfo = curl_getinfo($curl);
curl_close($curl);
// 解析响应结果
$responseResult = json_decode($response, true);
if ($responseResult) {
// 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
var_dump($responseResult);
} else {
// 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
// var_dump($httpInfo);
var_dump("请求异常");
}
import requests
# 1734-企业打款核验 - 代码参考(根据实际业务情况修改)
# 基本参数配置
apiUrl = 'https://apis.juhe.cn/enterprise_payment/query' # 接口请求URL
apiKey = '您申请的调用APIkey' # 在个人中心->我的数据,接口名称上方查看
# 接口请求入参配置
requestParams = {
'key': apiKey,
'codeType': 'xxx',
'code': 'xxx',
'companyName': 'xxx',
'personName': 'xxx',
'accountNo': 'xxx',
'accountBank': 'xxx',
'accountProv': '',
'accountCity': '',
'subBank': '',
}
# 发起接口网络请求
response = requests.get(apiUrl, params=requestParams)
# 解析响应结果
if response.status_code == 200:
responseResult = response.json()
# 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
print(responseResult)
else:
# 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
print('请求异常')
package main
import (
"encoding/json"
"fmt"
"net/http"
"net/url"
)
func main() {
// 基本参数配置
apiUrl := "https://apis.juhe.cn/enterprise_payment/query"
apiKey := "您申请的调用APIkey"
// 接口请求入参配置
requestParams := url.Values{}
requestParams.Set("key", apiKey)
requestParams.Set("codeType", "xxx")
requestParams.Set("code", "xxx")
requestParams.Set("companyName", "xxx")
requestParams.Set("personName", "xxx")
requestParams.Set("accountNo", "xxx")
requestParams.Set("accountBank", "xxx")
requestParams.Set("accountProv", "")
requestParams.Set("accountCity", "")
requestParams.Set("subBank", "")
// 发起接口网络请求
resp, err := http.Get(apiUrl + "?" + requestParams.Encode())
if err != nil {
fmt.Println("网络请求异常:", err)
return
}
defer resp.Body.Close()
var responseResult map[string]interface{}
err = json.NewDecoder(resp.Body).Decode(&responseResult)
if err != nil {
fmt.Println("解析响应结果异常:", err)
return
}
fmt.Println(responseResult)
}
using System;
using System.Net;
using Newtonsoft.Json;
using System.Collections.Generic;
using System.Linq;
namespace Common_API_Test.Test_Demo
{
class Csharp_get
{
static void Main(string[] args)
{
string url = "https://apis.juhe.cn/enterprise_payment/query";
string apiKey = "您申请的调用APIkey";
Dictionary<string, string> data = new Dictionary<string, string>();
data.Add("key", apiKey);
data.Add( "codeType", "xxx");
data.Add( "code", "xxx");
data.Add( "companyName", "xxx");
data.Add( "personName", "xxx");
data.Add( "accountNo", "xxx");
data.Add( "accountBank", "xxx");
data.Add( "accountProv", "");
data.Add( "accountCity", "");
data.Add( "subBank", "");
using (WebClient client = new WebClient())
{
string fullUrl = url + "?" + string.Join("&", data.Select(x => x.Key + "=" + x.Value));
try
{
string responseContent = client.DownloadString(fullUrl);
dynamic responseData = JsonConvert.DeserializeObject(responseContent);
if (responseData != null)
{
Console.WriteLine("Return Code: " + responseData["error_code"]);
Console.WriteLine("Return Message: " + responseData["reason"]);
}
else
{
Console.WriteLine("json解析异常!");
}
}
catch (Exception)
{
Console.WriteLine("请检查其它错误");
}
}
}
}
}
const axios = require('axios'); // npm install axios
// 基本参数配置
const apiUrl = 'https://apis.juhe.cn/enterprise_payment/query'; // 接口请求URL
const apiKey = '您申请的调用APIkey'; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
const requestParams = {
key: apiKey,
codeType: 'xxx',
code: 'xxx',
companyName: 'xxx',
personName: 'xxx',
accountNo: 'xxx',
accountBank: 'xxx',
accountProv: '',
accountCity: '',
subBank: '',
};
// 发起接口网络请求
axios.get(apiUrl, {params: requestParams})
.then(response => {
// 解析响应结果
if (response.status === 200) {
const responseResult = response.data;
// 网络请求成功。可依据业务逻辑和接口文档说明自行处理。
console.log(responseResult);
} else {
// 网络异常等因素,解析结果异常。可依据业务逻辑自行处理。
console.log('请求异常');
}
})
.catch(error => {
// 网络请求失败,可以根据实际情况进行处理
console.log('网络请求失败:', error);
});
package cn.juhe.test;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.URL;
import java.net.URLEncoder;
import java.nio.charset.StandardCharsets;
import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
public class JavaGet {
public static void main(String[] args) throws Exception {
String apiKey = "你申请的key";
String apiUrl = "https://apis.juhe.cn/enterprise_payment/query";
HashMap<String, String> map = new HashMap<>();
map.put("key", apiKey);
map.put("codeType", "xxx");
map.put("code", "xxx");
map.put("companyName", "xxx");
map.put("personName", "xxx");
map.put("accountNo", "xxx");
map.put("accountBank", "xxx");
map.put("accountProv", "");
map.put("accountCity", "");
map.put("subBank", "");
URL url = new URL(String.format("%s?%s", apiUrl, params(map)));
BufferedReader in = new BufferedReader(new InputStreamReader((url.openConnection()).getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
System.out.println(response);
}
public static String params(Map<String, String> map) {
return map.entrySet().stream()
.map(entry -> {
try {
return entry.getKey() + "=" + URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8.toString());
} catch (Exception e) {
e.printStackTrace();
return entry.getKey() + "=" + entry.getValue();
}
})
.collect(Collectors.joining("&"));
}
}
// 基本参数配置
NSString *apiUrl = @"https://apis.juhe.cn/enterprise_payment/query"; // 接口请求URL
NSString *apiKey = @"您申请的调用APIkey"; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
NSDictionary *requestParams = @{
@"key": apiKey,
@"codeType": @"xxx",
@"code": @"xxx",
@"companyName": @"xxx",
@"personName": @"xxx",
@"accountNo": @"xxx",
@"accountBank": @"xxx",
@"accountProv": @"",
@"accountCity": @"",
@"subBank": @"",
};
// 发起接口网络请求
NSURLComponents *components = [NSURLComponents componentsWithString:apiUrl];
NSMutableArray *queryItems = [NSMutableArray array];
[requestParams enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSString *value, BOOL *stop) {
[queryItems addObject:[NSURLQueryItem queryItemWithName:key value:value]];
}];
components.queryItems = queryItems;
NSURL *url = components.URL;
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
if (error) {
// 网络请求异常处理
NSLog(@"请求异常");
} else {
NSError *jsonError;
NSDictionary *responseResult = [NSJSONSerialization JSONObjectWithData:data options:0 error:&jsonError];
if (!jsonError) {
// 网络请求成功处理
// NSLog(@"%@", [responseResult objectForKey:@"error_code"]);
NSLog(@"%@", responseResult);
} else {
// 解析结果异常处理
NSLog(@"解析结果异常");
}
}
}];
[task resume];
返回参数说明:
| 名称 | 类型 | 说明 | |
|---|---|---|---|
| error_code | int | 返回码(返回0时计费一次,其他不计费) | |
| reason | string | 返回说明 | |
| result | jsonObject | 返回结果集 | |
| result.orderid | string | 单号 | |
| result.error_code_detail | string | 查询详情错误码(4位数字字符串) 说明,error_code为0时返回 error_code_detail,result.reason_detail 0000,认证成功 0001,银行交易超时,请重试 0002,转账中,请查看银行账户 0003,转账未成功,请联系开户行核实账户信息 0004,付款银行名称有误 0005,收款账户不支持此业务 0006,收款方账户状态异常或已注销 0007,银行查无此账号 0008,收款账户名称和账户号码不一致 0009,账户名称与银行记录不符 0010, 企业名称与法人信息不一致 0011, 转账未成功,请稍后重试 |
|
| result.reason_detail | string | 查询具体结果,详见error_code_detail说明 说明,error_code为0时返回 |
|
| result.transAmt | string | 认证成功时返回转账金额,整数 说明,error_code_detail为0000时返回 以分为单位 |
|
| result.randomNum | string | 打款备注随机数,6位随机数字 说明,error_code_detail为0000时返回 |
|
| result.orderStatus | string | 是否已经打款成功 说明,error_code_detail为0000时返回 成功返回固定值0000 失败则不返回该字段 |
JSON返回示例:JSON在线格式化工具 >
------------------------------认证成功时返回(计费)-----------------------------------------------------------
{
"reason":"请求成功",
"result":{
"reason_detail":"认证成功",
"error_code_detail":"0000",
"transAmt":"80",
"orderStatus":"0000",
"randomNum":"235495",
"orderid":"JH712220620142030267789Qr"
},
"error_code":0
}
------------------------------认证失败时返回(计费)-----------------------------------------------------------
{
"reason": "请求成功",
"result": {
"reason_detail": "付款银行名称有误",
"error_code_detail": "0004",
"orderid": "JH712220620144933297490Pv"
},
"error_code": 0
}
------------------------------其他错误时返回(不计费)-----------------------------------------------------------
{
"reason": "请求错误",
"result": {
"orderid": "JH712220620144933297490Pv"
},
"error_code": 271203
}
服务级错误码参照(error_code):
| 错误码 | 说明 | |
|---|---|---|
| 271201 | 网络错误 | |
| 271202 | 参数异常 | |
| 271203 | 查询失败 |
系统级错误码参照:
| 错误码 | 说明 | 旧版本(resultcode) | |
|---|---|---|---|
| 10001 | 错误的请求KEY | 101 | |
| 10002 | 该KEY无请求权限 | 102 | |
| 10003 | KEY过期 | 103 | |
| 10004 | 错误的OPENID | 104 | |
| 10005 | 应用未审核超时,请提交认证 | 105 | |
| 10007 | 未知的请求源 | 107 | |
| 10008 | 被禁止的IP | 108 | |
| 10009 | 被禁止的KEY | 109 | |
| 10011 | 当前IP请求超过限制 | 111 | |
| 10012 | 请求超过次数限制 | 112 | |
| 10013 | 测试KEY超过请求限制 | 113 | |
| 10014 | 系统内部异常(调用充值类业务时,请务必联系客服或通过订单查询接口检测订单,避免造成损失) | 114 | |
| 10020 | 接口维护 | 120 | |
| 10021 | 接口停用 | 121 |
错误码格式说明(示例:200201):
| 2 | 002 | 01 | |
|---|---|---|---|
| 服务级错误(1为系统级错误) | 服务模块代码(即数据ID) | 具体错误代码 |
接口文档下载
苏公网安备 32059002001776号