债券违约
请求Header:
| 名称 | 值 | |
|---|---|---|
| Content-Type | application/x-www-form-urlencoded |
请求参数说明:
| 名称 | 必填 | 类型 | 说明 | |
|---|---|---|---|---|
| key | 是 | string | 在个人中心->我的数据,接口名称上方查看 | |
| defSubjectName | 否 | string | 违约主体名称 | |
| bondName | 否 | string | 债券简称 | |
| secCode | 否 | string | 债券代码 | |
| firstDefDateBeg | 否 | string | 首次违约日起始 | |
| firstDefDateEnd | 否 | string | 首次违约日截至 | |
| firstDefReason | 否 | string | 多选。多个用英文逗号隔开;枚举值:一般情况无法兑付;交叉违约(触发条款,不涉兑付);技术性违约;公司重组;公司破产;达成展期议案/展期兑付;追加担保未履行;提前到期未兑付;交叉违约引起债券提前到期未兑付;公司重整引起债券提前到期未兑付;加速到期未兑付;持有人大会提前到期未兑付;境外债务违约引起提前到期未兑付;其他 | |
| pageIndex | 否 | string | 页数,请求显示第几页,默认显示第一页 | |
| pageSize | 否 | string | 默认20条 | |
| isRepay | 否 | string | 是否已偿还,多选:0-未偿还;1-已偿还 |
请求代码示例:
curl -k -i "https://apis.juhe.cn/api_credit/query837?key=key&defSubjectName=&bondName=&secCode=&firstDefDateBeg=&firstDefDateEnd=&firstDefReason=&pageIndex=&pageSize=&isRepay="
<?php
/**
* 2015-债券违约 - 代码参考(根据实际业务情况修改)
*/
// 基本参数配置
$apiUrl = "https://apis.juhe.cn/api_credit/query837"; // 接口请求URL
$method = "GET"; // 接口请求方式
$headers = ["Content-Type: application/x-www-form-urlencoded"]; // 接口请求header
$apiKey = "您申请的调用APIkey"; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
$requestParams = [
'key' => $apiKey,
'defSubjectName'=> '',
'bondName'=> '',
'secCode'=> '',
'firstDefDateBeg'=> '',
'firstDefDateEnd'=> '',
'firstDefReason'=> '',
'pageIndex'=> '',
'pageSize'=> '',
'isRepay'=> '',
];
$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
# 2015-债券违约 - 代码参考(根据实际业务情况修改)
# 基本参数配置
apiUrl = 'https://apis.juhe.cn/api_credit/query837' # 接口请求URL
apiKey = '您申请的调用APIkey' # 在个人中心->我的数据,接口名称上方查看
# 接口请求入参配置
requestParams = {
'key': apiKey,
'defSubjectName': '',
'bondName': '',
'secCode': '',
'firstDefDateBeg': '',
'firstDefDateEnd': '',
'firstDefReason': '',
'pageIndex': '',
'pageSize': '',
'isRepay': '',
}
# 发起接口网络请求
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/api_credit/query837"
apiKey := "您申请的调用APIkey"
// 接口请求入参配置
requestParams := url.Values{}
requestParams.Set("key", apiKey)
requestParams.Set("defSubjectName", "")
requestParams.Set("bondName", "")
requestParams.Set("secCode", "")
requestParams.Set("firstDefDateBeg", "")
requestParams.Set("firstDefDateEnd", "")
requestParams.Set("firstDefReason", "")
requestParams.Set("pageIndex", "")
requestParams.Set("pageSize", "")
requestParams.Set("isRepay", "")
// 发起接口网络请求
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/api_credit/query837";
string apiKey = "您申请的调用APIkey";
Dictionary<string, string> data = new Dictionary<string, string>();
data.Add("key", apiKey);
data.Add( "defSubjectName", "");
data.Add( "bondName", "");
data.Add( "secCode", "");
data.Add( "firstDefDateBeg", "");
data.Add( "firstDefDateEnd", "");
data.Add( "firstDefReason", "");
data.Add( "pageIndex", "");
data.Add( "pageSize", "");
data.Add( "isRepay", "");
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/api_credit/query837'; // 接口请求URL
const apiKey = '您申请的调用APIkey'; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
const requestParams = {
key: apiKey,
defSubjectName: '',
bondName: '',
secCode: '',
firstDefDateBeg: '',
firstDefDateEnd: '',
firstDefReason: '',
pageIndex: '',
pageSize: '',
isRepay: '',
};
// 发起接口网络请求
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/api_credit/query837";
HashMap<String, String> map = new HashMap<>();
map.put("key", apiKey);
map.put("defSubjectName", "");
map.put("bondName", "");
map.put("secCode", "");
map.put("firstDefDateBeg", "");
map.put("firstDefDateEnd", "");
map.put("firstDefReason", "");
map.put("pageIndex", "");
map.put("pageSize", "");
map.put("isRepay", "");
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/api_credit/query837"; // 接口请求URL
NSString *apiKey = @"您申请的调用APIkey"; // 在个人中心->我的数据,接口名称上方查看
// 接口请求入参配置
NSDictionary *requestParams = @{
@"key": apiKey,
@"defSubjectName": @"",
@"bondName": @"",
@"secCode": @"",
@"firstDefDateBeg": @"",
@"firstDefDateEnd": @"",
@"firstDefReason": @"",
@"pageIndex": @"",
@"pageSize": @"",
@"isRepay": @"",
};
// 发起接口网络请求
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 | 返回码 | |
| reason | string | 返回说明 | |
| result | object | 返回结果 | |
| orderid | string | 流水号 | |
| totalCount | int | 总条数 | |
| totalPage | int | 总页数 | |
| pageSize | int | 每页条数 | |
| pageIndex | int | 当前页 | |
| data | jsonArray | 具体结果 | |
| secInnerCode | VARCHAR(200) | 债券内码 | |
| bondCombCode | VARCHAR(200) | 债券组合代码 | |
| defSubjectName | VARCHAR(400) | 违约主体名称 | |
| bondName | VARCHAR(400) | 债券简称 | |
| secCode | VARCHAR(200) | 债券代码 | |
| firstDefDate | VARCHAR(50) | 首次违约日 | |
| defBondStock | VARCHAR(400) | 违约时债券存量 | |
| firstPayState | VARCHAR(400) | 首次违约支付状态 | |
| firstDefReason | VARCHAR(400) | 首次违约原因 | |
| latestDefDate | VARCHAR(50) | 最新违约日 | |
| latestDefAmt | VARCHAR(200) | 最新违约金额(万元) | |
| latestDefReason | VARCHAR(400) | 最新违约原因 | |
| defAmt | VARCHAR(200) | 违约金额(万元) | |
| accuLateDefPrincipal | VARCHAR(200) | 违约时逾期本金累计(万元) | |
| accuLateDefInt | VARCHAR(200) | 违约时逾期利息累计(万元) | |
| isRepay | VARCHAR(40) | 是否已偿还 | |
| accuRepayAmt | VARCHAR(200) | 累计偿还金额(万元) | |
| remainSolveScale | VARCHAR(200) | 剩余未解决规模(万元) | |
| repayProg | VARCHAR(200) | 偿还进度 | |
| latestSolveDate | VARCHAR(50) | 最新解决日期 | |
| latestSolveWay | VARCHAR(400) | 最新解决方式 | |
| latestSolveScale | VARCHAR(200) | 最新解决规模(万元) | |
| defBondDetail | JSONARRAY | 违约债券明细 | |
| defBondSolveDetail | JSONARRAY | 违约债券解决明细 | |
| announTitle | VARCHAR(4000) | 公告标题 | |
| announSrc | VARCHAR(200) | 公告来源 | |
| violateAnnounDate | VARCHAR(50) | 违约公告日期 | |
| violateUpdateDate | VARCHAR(50) | 违约公告更新日期 | |
| defBondDetail(违约债券明细) | |||
| remark | TEXT | 备注 | |
| source | VARCHAR(4000) | 信息来源 | |
| payState | VARCHAR(400) | 支付状态 | |
| delayTerm | VARCHAR(400) | 延期期限 | |
| noticeDate | VARCHAR(50) | 公告日期 | |
| updateDate | VARCHAR(50) | 更新日期 | |
| actpayScale | VARCHAR(50) | 实付规模(万元) | |
| violateDate | VARCHAR(50) | 违约日期 | |
| cashflowType | VARCHAR(4000) | 现金流类型 | |
| noticeSource | VARCHAR(4000) | 公告标题 | |
| payableScale | VARCHAR(50) | 应付规模(万元) | |
| securityCode | VARCHAR(200) | 债券代码 | |
| violateScale | VARCHAR(50) | 违约规模(万元) | |
| violateReason | VARCHAR(4000) | 违约原因 | |
| bondCombineCode | VARCHAR(200) | 债券组合代码 | |
| isActualViolate | VARCHAR(50) | 是否实际违约 | |
| isCollectiveBond | VARCHAR(50) | 是否集合债券 | |
| violateBondStock | VARCHAR(50) | 违约时债券存量(万元) | |
| securityInnerCode | VARCHAR(200) | 债券内码 | |
| violateSituationExplain | TEXT违约情况说明 | ||
| announSrc | VARCHAR(200) | 公告来源 | |
| defBondSolveDetail(违约债券解决明细) | |||
| remark | TEXT | 备注 | |
| source | VARCHAR(4000) | 信息来源 | |
| solveWay | VARCHAR(4000) | 解决方式 | |
| solveDate | VARCHAR(50) | 解决日期 | |
| noticeDate | VARCHAR(50) | 公告日期 | |
| solveScale | VARCHAR(50) | 解决规模(万元) | |
| solveState | VARCHAR(400) | 解决状态 | |
| updateDate | VARCHAR(50) | 更新日期 | |
| violateDate | VARCHAR(50) | 违约日期 | |
| cashflowType | VARCHAR(4000) | 现金流类型 | |
| noticeSource | VARCHAR(4000) | 公告标题 | |
| securityCode | VARCHAR(200) | 债券代码 | |
| unsolveScale | VARCHAR(50) | 未解决规模(万元) | |
| solveSituation | TEXT | 解决情况说明 | |
| punishAmtScale | VARCHAR(50) | 罚金规模(万元) | |
| announSrc | VARCHAR(200) | 公告来源 |
JSON返回示例:JSON在线格式化工具 >
{
"reason": "成功",
"result": {
"orderid": "JH837260414104620wYg2K",
"data": [
{
"secInnerCode": "1001811359",
"bondCombCode": "80225103",
"defSubjectName": "苏宁易购集团股份有限公司",
"bondName": "19云智优",
"secCode": "139510",
"firstDefDate": "2025-03-31",
"defBondStock": "30394.00000000",
"firstPayState": "延期支付",
"firstDefReason": "达成展期议案/展期兑付",
"latestDefDate": "2025-03-31",
"latestDefAmt": "30394.00000000",
"latestDefReason": "达成展期议案/展期兑付",
"defAmt": "30394.00000000",
"accuLateDefPrincipal": "30394.00000000",
"accuLateDefInt": "",
"isRepay": "0",
"accuRepayAmt": "",
"remainSolveScale": "",
"repayProg": "0.00%",
"latestSolveDate": "",
"latestSolveWay": "",
"latestSolveScale": "",
"defBondDetail": [
{
"remark": "",
"source": "其他",
"payState": "延期支付",
"delayTerm": "2028年3月30日",
"noticeDate": "2025-03-31",
"updateDate": "2025-03-31",
"actpayScale": "0E-8",
"violateDate": "2025-03-31",
"cashflowType": "还本",
"noticeSource": "",
"payableScale": "30394.00000000",
"securityCode": "139510",
"violateScale": "30394.00000000",
"violateReason": "达成展期议案/展期兑付",
"bondCombineCode": "80225103",
"isActualViolate": "1",
"isCollectiveBond": "0",
"violateBondStock": "30394.00000000",
"securityInnerCode": "1001811359",
"violateSituationExplain": "",
"announSrc": ""
}
],
"defBondSolveDetail": [],
"announTitle": "",
"announSrc": "",
"violateAnnounDate": "2025-03-31",
"violateUpdateDate": "2025-03-31"
},
{
"secInnerCode": "1001811678",
"bondCombCode": "80225140",
"defSubjectName": "苏宁易购集团股份有限公司",
"bondName": "19云智次",
"secCode": "139511",
"firstDefDate": "2025-03-31",
"defBondStock": "3700.00000000",
"firstPayState": "延期支付",
"firstDefReason": "达成展期议案/展期兑付",
"latestDefDate": "2025-03-31",
"latestDefAmt": "3700.00000000",
"latestDefReason": "达成展期议案/展期兑付",
"defAmt": "3700.00000000",
"accuLateDefPrincipal": "3700.00000000",
"accuLateDefInt": "",
"isRepay": "0",
"accuRepayAmt": "",
"remainSolveScale": "",
"repayProg": "0.00%",
"latestSolveDate": "",
"latestSolveWay": "",
"latestSolveScale": "",
"defBondDetail": [
{
"remark": "",
"source": "其他",
"payState": "延期支付",
"delayTerm": "2028年3月30日",
"noticeDate": "2025-03-31",
"updateDate": "2025-03-31",
"actpayScale": "0E-8",
"violateDate": "2025-03-31",
"cashflowType": "还本",
"noticeSource": "",
"payableScale": "3700.00000000",
"securityCode": "139511",
"violateScale": "3700.00000000",
"violateReason": "达成展期议案/展期兑付",
"bondCombineCode": "80225140",
"isActualViolate": "1",
"isCollectiveBond": "0",
"violateBondStock": "3700.00000000",
"securityInnerCode": "1001811678",
"violateSituationExplain": "",
"announSrc": ""
}
],
"defBondSolveDetail": [],
"announTitle": "",
"announSrc": "",
"violateAnnounDate": "2025-03-31",
"violateUpdateDate": "2025-03-31"
}
],
"totalCount": 2,
"totalPage": 1,
"pageSize": 20,
"pageIndex": 1
},
"error_code": 0
}
服务级错误码参照(error_code):
| 错误码 | 说明 | |
|---|---|---|
| 283701 | 参数错误 | |
| 283702 | 查无记录 | |
| 283703 | 网络错误 | |
| 283704 | 查询失败 |
系统级错误码参照:
| 错误码 | 说明 | 旧版本(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号