區(qū)塊鏈金融API

區(qū)塊鏈API

版本:
v0.1

日期:
2017年05月27日

目錄

[TOC]

消息字段

//omsId,"LOAN_"+"OMSID_"+時間戳
String id

//借款標題
String titlec

//OMSID
String omsId

//oms name
String omsName

//OMS錢包地址
String omsWalletAddress

//借款人姓名
String borrowerName

//借款人電話
String borrowerPhone

//借款人地址
String borrowerAddress

//借款人身份證號
String borrowerIdCardNumber

//借款人錢包地址
String borrowerWalletAddress

//借款人說明
String borrowerDescription

//10 發(fā)售中;20 已滿額(待扣投資款);30 已流標;40 待還款;50 待扣還款薪棒?;60 已結清;70 已逾期累奈?
int status

//計息方式,暫只支持按年
int rateTimeUnit

//利率(年)
Double rate

//借款額
Double amount

//oms收費,借款人收到資金=amount-omsFee
Double omsFee

//利息總額
Double interestAmount

//還款總額=借款額+利息總額
Double refundAmount

//審批狀態(tài),未使用
int approveStatus

//審批時間麦锯,未使用
Timestamp approveTime

//期限時間單位,暫時未啟用
int periodTimeUnit

//期限琅绅,天
int period

//還款方式扶欣,暫時只支持到期全款支付
int refundType

//籌標截止時間
Timestamp deadTime

//起息時間,標滿開始計息
Timestamp startTime

//計劃還款時間千扶,startTime+period
Timestamp refundTime

//實際還款時間
Timestamp realRefoundTime

//已認購金額
Double enterAmount

//已認購筆數
int enterCount

//已還款
Boolean isRefunded

//序列號料祠,未使用
String serialNumber

//合同號,未使用
String contractCode

//合同描述,未使用
String contractDesc

//起投金額
Double startInvestAmount

//遞增金額
Double increaseInvestAmount

//區(qū)塊鏈txid
String chainTxId

//區(qū)塊號
String blockId

//描述
String description

//資金用途
String fundUsage

//還款來源
String repaySource

//征信
String creditInformation

//擔保信息
String guaranteeInformation
用戶
//用戶id
String id

//手機號,登錄用戶
String mobilePhone

//密碼
String password

//姓名
String realName

//注冊時間
Timestamp registerTime

//身份證號
String idCardNumber

//實名認證狀態(tài)。0 創(chuàng)建;10 已實名驗證;20 已導入錢包
int authStatus

//實名認證時間
Timestamp authTime

//錢包地址
String walletAddress

//錢包pubKey
String walletPubKey

//總資產
Double totalAmount

//可用資產
Double usableAmount

//凍結金額
Double frozenAmount

//投資總收益
Double interestAmount

//投資總筆數
int loanCount

//投資總金額
Double loanAmount

//已回收筆數
int recoveredCount

//已回收總金額
Double recoveredAmount

//已回收的本金
Double recoveredPrincipal

//已回收收益
Double recoveredInterest

//待回收筆數
int unRecoveredCount

//待回收總額
Double unrecoveredAmount

//待回收的本金
Double unRecoveredPrincipal

//待回收的收益
Double unRecoveredInterest
投資
//"INVEST_"+"marketId_"+"13位時間戳"
String id

//標ID
String loanId

//oms id
String omsId

//market Id
String marketId

//投資人id
String investorId

//投資人身份證號
String investorIdCardNumber

//投資人錢包地址
String inverstorWalletAddress

//投資金額
Double amount

//預期收益
Double interestAmount

//回款總金額
Double refundAmount

//10,投資提交20,資金已凍結30,取消投資40,待扣投資款50,待回款60,已還款70,已逾期澎羞?
int status

//創(chuàng)建時間
Timestamp createTime

//開始計息時間
Timestamp startTime

//到期時間
Timestamp refoundTime

//實際回款時間
Timestamp realRefoundTime

//區(qū)塊鏈txid
String chainTxId

//區(qū)塊號
String blockId

API

1 OMS

1.1 借款上鏈

URL

https://apis.qianbao.com/jiedai/v1/oms/loan

Method

POST

Header

Content-type: application/x-www-form-urlencoded;charset=utf-8

RequestBody

"title": "天津買房首付",
"borrowerName": "zz",
"borrowerIdCardNumber": "10100000000000000",
"borrowerWalletAddress": "walet101",
"borrowerPhone": "13888888888",
"borrowerAddress": "北京市朝陽區(qū)",
"borrowerDescription": "一個好人",
"amount": 500000,
"omsFee": 5000,
"rate": 0.1,
"period": 90,
"interestAmount": 12328.77,
"deadTime": "2017-07-31 23:59:59",
"startInvestAmount": 10000,
"increaseInvestAmount": 1000,
"description": "good",
"fundUsage": "買房",
"repaySource": "工資",
"creditInformation": "very good",
"guaranteeInformation": "趙老板"

ReponseBody

{
    "status": "20000551",
    "message": "OK"
}
1.2 查詢借款列表

URL

https://apis.qianbao.com/jiedai/v1/oms/loans?status={status}

status參數可選

Method

GET

ReponseBody:

{
    "status": "20000551",
    "message": "OK",
    "result": [
        {
            "id": "LOAN_oms001_1500606584559",
            "title": "天津買房首付",
            "omsId": "oms001",
            "omsName": "乾元OMS",
            "omsWalletAddress": "wallet_Oms001",
            "borrowerName": "zz",
            "borrowerPhone": "13888888888",
            "borrowerAddress": "北京市朝陽區(qū)",
            "borrowerIdCardNumber": "10100000000000000",
            "borrowerWalletAddress": "walet101",
            "borrowerDescription": "一個好人",
            "status": 10,
            "rateTimeUnit": 2,
            "rate": 0.1,
            "amount": 500000,
            "omsFee": 5000,
            "interestAmount": 12328.77,
            "refundAmount": 512328.77,
            "approveStatus": 3,
            "approveTime": 1500606585000,
            "periodTimeUnit": 1,
            "period": 90,
            "refundType": 0,
            "deadTime": 1501516799000,
            "enterAmount": 0,
            "enterCount": 0,
            "isRefunded": false,
            "startInvestAmount": 10000,
            "increaseInvestAmount": 1000,
            "description": "good",
            "fundUsage": "買房",
            "repaySource": "工資",
            "creditInformation": "very good",
            "guaranteeInformation": "趙老板"
        },
        {
            "id": "LOAN_oms001_1500606668343",
            "title": "登錄火星",
            "omsId": "oms001",
            "omsName": "乾元OMS",
            "omsWalletAddress": "wallet_Oms001",
            "borrowerName": "gx",
            "borrowerPhone": "13888888888",
            "borrowerAddress": "北京市朝陽區(qū)",
            "borrowerIdCardNumber": "10100000000000000",
            "borrowerWalletAddress": "walet101",
            "borrowerDescription": "一個好人",
            "status": 10,
            "rateTimeUnit": 2,
            "rate": 0.1,
            "amount": 500000,
            "omsFee": 5000,
            "interestAmount": 12328.77,
            "refundAmount": 512328.77,
            "approveStatus": 3,
            "approveTime": 1500606669000,
            "periodTimeUnit": 1,
            "period": 90,
            "refundType": 0,
            "deadTime": 1501516799000,
            "enterAmount": 0,
            "enterCount": 0,
            "isRefunded": false,
            "startInvestAmount": 10000,
            "increaseInvestAmount": 1000,
            "description": "good",
            "fundUsage": "火星",
            "repaySource": "火星采礦",
            "creditInformation": "very good",
            "guaranteeInformation": "趙老板"
        }
    ]
}
1.3 查詢借款

URL

https://apis.qianbao.com/jiedai/v1/oms/loan/{id}

Method

GET

ReponseBody:

{
    "status": "20000551",
    "message": "OK",
    "result": {
        "id": "LOAN_oms001_1500606584559",
        "title": "天津買房首付",
        "omsId": "oms001",
        "omsName": "乾元OMS",
        "omsWalletAddress": "wallet_Oms001",
        "borrowerName": "zz",
        "borrowerPhone": "13888888888",
        "borrowerAddress": "北京市朝陽區(qū)",
        "borrowerIdCardNumber": "10100000000000000",
        "borrowerWalletAddress": "walet101",
        "borrowerDescription": "一個好人",
        "status": 10,
        "rateTimeUnit": 2,
        "rate": 0.1,
        "amount": 500000,
        "omsFee": 5000,
        "interestAmount": 12328.77,
        "refundAmount": 512328.77,
        "approveStatus": 3,
        "approveTime": 1500606585000,
        "periodTimeUnit": 1,
        "period": 90,
        "refundType": 0,
        "deadTime": 1501516799000,
        "enterAmount": 0,
        "enterCount": 0,
        "isRefunded": false,
        "startInvestAmount": 10000,
        "increaseInvestAmount": 1000,
        "description": "good",
        "fundUsage": "買房",
        "repaySource": "工資",
        "creditInformation": "very good",
        "guaranteeInformation": "趙老板"
    }
}

參數錯誤
{
    "message": "借款不存在",
    "status": "40400551"
}

2 p2p

2.1 查詢借款列表

URL

https://apis.qianbao.com/jiedai/v1/p2p/loans?status={status}

status參數可選

Method

GET

ReponseBody:

參考1.2
2.2 查詢借款

URL

curl https://apis.qianbao.com/jiedai/v1/p2p/loans/{id}

Method

GET

ReponseBody:

參考1.3
2.3 注冊驗證碼

URL

https://apis.qianbao.com/jiedai/v1/p2p/register/sms?mobilePhone={mobilePhone}

Method

GET

ReponseBody:

{
    "status": "20000551",
    "message": "OK"
}
2.4 注冊

URL

https://apis.qianbao.com/jiedai/v1/p2p/register?smsCode=?

Method

POST

Header

Content-type: application/x-www-form-urlencoded;charset=utf-8

RequestBody

"mobilePhone":"18610274382"
"password":"123"

ReponseBody:

{
    "status": "20000551",
    "message": "OK",
    "result": {
        "token": "667d6b13a2314d5797722adca31aaa34",
        "investorId": "market001_investor_1500610469952"
    }
}
2.5 登錄

URL

https://apis.qianbao.com/jiedai/v1/p2p/login

Method

POST

Header

Content-type: application/x-www-form-urlencoded;charset=utf-8

RequestBody

"mobilePhone":"18610274382"
"password":"123"

ReponseBody:

{
    "status": "20000551",
    "message": "OK",
    "result": {
        "token": "7f9b75c28a264eac8582f3b58c02e3d1",
        "investorId": "market001_investor_1500610469952"
    }
}
2.6 退出登錄

URL

https://apis.qianbao.com/jiedai/v1/p2p/logout?QB_AUTH_TOKEN={token}

Method

DELETE

ReponseBody:

{
    "status": "20000551",
    "message": "OK"
}
2.7 實名認證

URL

 https://apis.qianbao.com/jiedai/v1/p2p/investor/auth?QB_AUTH_TOKEN={token}

Method

PUT

Header

"Content-type: application/json;charset=utf-8"

RequestBody

"realName":"高翔"
"idCardNumber":"42012345678901234"

ReponseBody:

{
    "status": "20000551",
    "message": "OK",
    "result": {
        "id": "market001_investor_1500610469952",
        "mobilePhone": "18610274382",
        "realName": "高翔",
        "registerTime": 1500610470000,
        "idCardNumber": "42012345678901234",
        "authStatus": 10,
        "authTime": 1500610750014,
        "totalAmount": 0,
        "usableAmount": 0,
        "frozenAmount": 0,
        "interestAmount": 0,
        "loanCount": 0,
        "loanAmount": 0,
        "recoveredCount": 0,
        "recoveredAmount": 0,
        "recoveredPrincipal": 0,
        "recoveredInterest": 0,
        "unRecoveredCount": 0,
        "unrecoveredAmount": 0,
        "unRecoveredPrincipal": 0,
        "unRecoveredInterest": 0
    }
}
2.8 導入錢包

URL

https://apis.qianbao.com/jiedai/v1/p2p/investor/wallet?QB_AUTH_TOKEN={token}

Method

PUT

Header

"Content-type: application/json;charset=utf-8"

RequestBody

"walletAddress":"Wallet18610274382"
"walletPubKey":"WalletPubKey001"

ReponseBody:

{
    "status": "20000551",
    "message": "OK",
    "result": {
        "id": "market001_investor_1500610469952",
        "mobilePhone": "18610274382",
        "realName": "高翔",
        "registerTime": 1500610470000,
        "idCardNumber": "42012345678901234",
        "authStatus": 20,
        "authTime": 1500610750000,
        "walletAddress": "Wallet18610274382",
        "totalAmount": 0,
        "usableAmount": 0,
        "frozenAmount": 0,
        "interestAmount": 0,
        "loanCount": 0,
        "loanAmount": 0,
        "recoveredCount": 0,
        "recoveredAmount": 0,
        "recoveredPrincipal": 0,
        "recoveredInterest": 0,
        "unRecoveredCount": 0,
        "unrecoveredAmount": 0,
        "unRecoveredPrincipal": 0,
        "unRecoveredInterest": 0
    }
}
2.9 當前用戶詳細信息

URL

https://apis.qianbao.com/jiedai/v1/p2p/investor?QB_AUTH_TOKEN={token}

Method

GET

ReponseBody:

{
    "status": "20000551",
    "message": "OK",
    "result": {
        "id": "market001_investor_1500610469952",
        "mobilePhone": "18610274382",
        "realName": "高翔",
        "registerTime": 1500610470000,
        "idCardNumber": "42012345678901234",
        "authStatus": 20,
        "authTime": 1500610750000,
        "walletAddress": "Wallet18610274382",
        "totalAmount": 0,
        "usableAmount": 0,
        "frozenAmount": 0,
        "interestAmount": 0,
        "loanCount": 0,
        "loanAmount": 0,
        "recoveredCount": 0,
        "recoveredAmount": 0,
        "recoveredPrincipal": 0,
        "recoveredInterest": 0,
        "unRecoveredCount": 0,
        "unrecoveredAmount": 0,
        "unRecoveredPrincipal": 0,
        "unRecoveredInterest": 0
    }
}
2.10 投資

URL

https://apis.qianbao.com/jiedai/v1/p2p/invest?QB_AUTH_TOKEN={token}

Method

POST

Header

"Content-type: application/json;charset=utf-8"

RequestBody

"loanId":"LOAN_oms001_1500186027844"
"amount":400000

ReponseBody:

{
    "status": "20000551",
    "message": "OK"
}

異常
{
    "message": "可投金額不足",
    "status": "40000551"
}
2.11 用戶投資列表

URL

curl https://apis.qianbao.com/jiedai/v1/p2p/invests?status={status}&QB_AUTH_TOKEN={token}

status參數可選

Method

GET

ReponseBody:

{
    "status": "20000551",
    "message": "OK",
    "result": [
        {
            "id": "INVEST_market001_1500611289445",
            "loanId": "LOAN_oms001_1500611158732",
            "omsId": "oms001",
            "marketId": "market001",
            "investorId": "market001_investor_1500610469952",
            "investorIdCardNumber": "42012345678901234",
            "inverstorWalletAddress": "Wallet18610274382",
            "amount": 100000,
            "interestAmount": 2465.76,
            "refundAmount": 102465.76,
            "status": 10,
            "createTime": 1500611289000,
            "startTime": 1500611339000,
            "refoundTime": 1508387339000
        },
        {
            "id": "INVEST_market001_1500611339482",
            "loanId": "LOAN_oms001_1500611158732",
            "omsId": "oms001",
            "marketId": "market001",
            "investorId": "market001_investor_1500610469952",
            "investorIdCardNumber": "42012345678901234",
            "inverstorWalletAddress": "Wallet18610274382",
            "amount": 400000,
            "interestAmount": 9863.01,
            "refundAmount": 409863.01,
            "status": 10,
            "createTime": 1500611339000,
            "startTime": 1500611339000,
            "refoundTime": 1508387339000
        }
    ]
}
2.12 查詢指定投資

URL

curl https://apis.qianbao.com/jiedai/v1/p2p/invest/{id}?QB_AUTH_TOKEN={token}

Method

GET

ReponseBody:

{
    "status": "20000551",
    "message": "OK",
    "result": {
        "id": "INVEST_market001_1500611289445",
        "loanId": "LOAN_oms001_1500611158732",
        "omsId": "oms001",
        "marketId": "market001",
        "investorId": "market001_investor_1500610469952",
        "investorIdCardNumber": "42012345678901234",
        "inverstorWalletAddress": "Wallet18610274382",
        "amount": 100000,
        "interestAmount": 2465.76,
        "refundAmount": 102465.76,
        "status": 10,
        "createTime": 1500611289000,
        "startTime": 1500611339000,
        "refoundTime": 1508387339000
    }
}
最后編輯于
?著作權歸作者所有,轉載或內容合作請聯(lián)系作者
  • 序言:七十年代末髓绽,一起剝皮案震驚了整個濱河市,隨后出現(xiàn)的幾起案子妆绞,更是在濱河造成了極大的恐慌顺呕,老刑警劉巖,帶你破解...
    沈念sama閱讀 210,978評論 6 490
  • 序言:濱河連續(xù)發(fā)生了三起死亡事件括饶,死亡現(xiàn)場離奇詭異株茶,居然都是意外死亡,警方通過查閱死者的電腦和手機巷帝,發(fā)現(xiàn)死者居然都...
    沈念sama閱讀 89,954評論 2 384
  • 文/潘曉璐 我一進店門忌卤,熙熙樓的掌柜王于貴愁眉苦臉地迎上來,“玉大人楞泼,你說我怎么就攤上這事驰徊。” “怎么了堕阔?”我有些...
    開封第一講書人閱讀 156,623評論 0 345
  • 文/不壞的土叔 我叫張陵棍厂,是天一觀的道長。 經常有香客問我超陆,道長牺弹,這世上最難降的妖魔是什么浦马? 我笑而不...
    開封第一講書人閱讀 56,324評論 1 282
  • 正文 為了忘掉前任,我火速辦了婚禮张漂,結果婚禮上晶默,老公的妹妹穿的比我還像新娘。我一直安慰自己航攒,他們只是感情好磺陡,可當我...
    茶點故事閱讀 65,390評論 5 384
  • 文/花漫 我一把揭開白布。 她就那樣靜靜地躺著漠畜,像睡著了一般币他。 火紅的嫁衣襯著肌膚如雪。 梳的紋絲不亂的頭發(fā)上憔狞,一...
    開封第一講書人閱讀 49,741評論 1 289
  • 那天蝴悉,我揣著相機與錄音,去河邊找鬼瘾敢。 笑死拍冠,一個胖子當著我的面吹牛,可吹牛的內容都是我干的廉丽。 我是一名探鬼主播倦微,決...
    沈念sama閱讀 38,892評論 3 405
  • 文/蒼蘭香墨 我猛地睜開眼妻味,長吁一口氣:“原來是場噩夢啊……” “哼正压!你這毒婦竟也來了?” 一聲冷哼從身側響起责球,我...
    開封第一講書人閱讀 37,655評論 0 266
  • 序言:老撾萬榮一對情侶失蹤焦履,失蹤者是張志新(化名)和其女友劉穎,沒想到半個月后雏逾,有當地人在樹林里發(fā)現(xiàn)了一具尸體嘉裤,經...
    沈念sama閱讀 44,104評論 1 303
  • 正文 獨居荒郊野嶺守林人離奇死亡,尸身上長有42處帶血的膿包…… 初始之章·張勛 以下內容為張勛視角 年9月15日...
    茶點故事閱讀 36,451評論 2 325
  • 正文 我和宋清朗相戀三年栖博,在試婚紗的時候發(fā)現(xiàn)自己被綠了屑宠。 大學時的朋友給我發(fā)了我未婚夫和他白月光在一起吃飯的照片。...
    茶點故事閱讀 38,569評論 1 340
  • 序言:一個原本活蹦亂跳的男人離奇死亡仇让,死狀恐怖典奉,靈堂內的尸體忽然破棺而出,到底是詐尸還是另有隱情丧叽,我是刑警寧澤卫玖,帶...
    沈念sama閱讀 34,254評論 4 328
  • 正文 年R本政府宣布,位于F島的核電站踊淳,受9級特大地震影響假瞬,放射性物質發(fā)生泄漏。R本人自食惡果不足惜,卻給世界環(huán)境...
    茶點故事閱讀 39,834評論 3 312
  • 文/蒙蒙 一脱茉、第九天 我趴在偏房一處隱蔽的房頂上張望剪芥。 院中可真熱鬧,春花似錦琴许、人聲如沸粗俱。這莊子的主人今日做“春日...
    開封第一講書人閱讀 30,725評論 0 21
  • 文/蒼蘭香墨 我抬頭看了看天上的太陽寸认。三九已至,卻和暖如春串慰,著一層夾襖步出監(jiān)牢的瞬間偏塞,已是汗流浹背。 一陣腳步聲響...
    開封第一講書人閱讀 31,950評論 1 264
  • 我被黑心中介騙來泰國打工邦鲫, 沒想到剛下飛機就差點兒被人妖公主榨干…… 1. 我叫王不留灸叼,地道東北人。 一個月前我還...
    沈念sama閱讀 46,260評論 2 360
  • 正文 我出身青樓庆捺,卻偏偏與公主長得像古今,于是被迫代替她去往敵國和親。 傳聞我的和親對象是個殘疾皇子滔以,可洞房花燭夜當晚...
    茶點故事閱讀 43,446評論 2 348

推薦閱讀更多精彩內容

  • Spring Cloud為開發(fā)人員提供了快速構建分布式系統(tǒng)中一些常見模式的工具(例如配置管理捉腥,服務發(fā)現(xiàn),斷路器你画,智...
    卡卡羅2017閱讀 134,628評論 18 139
  • REST API 可以讓你用任何支持發(fā)送 HTTP 請求的設備來與 Parse 進行交互抵碟,你可以使用 REST A...
    Caroline嗯哼閱讀 2,000評論 0 0
  • Nginx API for Lua Introduction ngx.arg ngx.var.VARIABLE C...
    吃瓜的東閱讀 5,731評論 0 5
  • iOS網絡架構討論梳理整理中。坏匪。拟逮。 其實如果沒有APIManager這一層是沒法使用delegate的,畢竟多個單...
    yhtang閱讀 5,172評論 1 23
  • 為了遇見你 我趟過每一條山澗泉水匯成的小溪 我踏遍每一片芬芳綠意鋪就的土地 我叩拜每一座蔥郁菩提庇佑的寺宇 尋尋覓...
    劉吖撒閱讀 323評論 2 3