通用 API

Account

获取账户配置

GET

/open-api/v1/accounts/configuration

Headers:

Header Parameters 说明
x-qbit-access-token string access token
Content-Type application/json json 类型

返回参数:

字段 类型 说明
cardCount number 剩余可开卡数
cardLimit number 可开卡总数

请求示例:

curl -X GET \
  https://global.service.staging.qbitnetwork.com/open-api/v1/accounts/configuration \
	-H  'content-type: application/json' \
    -H  'x-qbit-access-token: db19fa75f4ed674135e26965173ff66f722684bb'
1
2
3
4

返回示例:

{
  "code": 0,
  "message": "ok",
  "data": {
    "cardCount": 95,
    "cardLimit": 100
  }
}
1
2
3
4
5
6
7
8

注册 Qbit 账户

POST

/open-api/v1/accounts/register

Headers:

Header Parameters 说明
x-qbit-access-token string access token
Content-Type application/json json 类型

POST 请求参数:

字段 类型 是否为必填 说明
phone string 手机号码(需要带国际区号,例如+8616612345678)
email string 邮箱
name string 企业名

返回参数:

字段 类型 说明
accountId string 账户 id
userId string user id
domain string domain

请求示例:

curl -X POST \
  https://global.service.staging.qbitnetwork.com/open-api/v1/accounts/register \
	-H  'content-type: application/json' \
    -H  'x-qbit-access-token: db19fa75f4ed674135e26965173ff66f722684bb' \
    -d '{
        "phone": "+8618668436517",
        "email": "1449681564@qq.com",
        "name": "***公司"
     }'
1
2
3
4
5
6
7
8
9

返回示例:

{
  "accountId": "4322fd4f-8458-42ea-9414-8362e1dc636a",
  "userId": "5abd4512-073f-43a0-a6e9-8378464f4e2f",
  "domain": "https://qbit-staging-web.qbitnetwork.com"
}
1
2
3
4
5

获取 Account 列表

GET

/open-api/v1/accounts

Headers:

Header Parameters 说明
x-qbit-access-token string access token
Content-Type application/json json 类型

GET 请求参数:

字段 类型 是否为必填 说明
id string 客户 Id,如果不传默认是所有 Client 下的 account
limit number 默认 10 条
page number 默认 0

返回参数:

字段 类型 说明
data Account[] Account 的对象数组
total number 总数

请求示例:

curl -X GET "https://global.service.staging.qbitnetwork.com/open-api/v1/accounts?accountId=c110e2aa-322b-4f3f-a795-f441955844ed" \
     -H  'content-type: application/json' \
     -H  'x-qbit-access-token: db19fa75f4ed674135e26965173ff66f722684bb'
1
2
3

返回示例:

{
  "data": [
    {
      "id": "5abd4512-073f-43a0-a6e9-8378464f4e2f",
      "status": "Active",
      "verifiedName": "张三有限公司",
      "displayId": "451972",
      "kycStatus": "Na",
      "cardKybStatus": "Na",
      "globalAccountKybStatus": "Na",
      "type": "MasterAccount"
    },
    {
      "id": "40d003aa-e919-4074-b928-7c99fe99db78",
      "status": "Active",
      "verifiedName": "李四有限公司",
      "displayId": "4519726542",
      "kycStatus": "Na",
      "cardKybStatus": "Na",
      "globalAccountKybStatus": "Na",
      "type": "SubAccount"
    }
  ],
  "total": 2
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25

User

每一个账户下可以有一个或者多个登录用户User,且设置相应的系统操作权限。在创建Account后,会自动创建第一个User ,默认为管理员的权限。账户的登录信息存储在Usermodel 中。

获取 User 列表

GET

/open-api/v1/users

Headers:

Header Parameters 说明
x-qbit-access-token string access token
Content-Type application/json json 类型

GET 请求参数:

字段 类型 是否为必填 说明
id string id
limit number 默认 10 条
page number 默认 0
accountId string 客户 Id

返回参数:

字段 类型 说明
data User[] User 对象的数组
total number 总数量

请求示例:

curl -X GET "https://global.service.staging.qbitnetwork.com/open-api/v1/users?limit=10&page=0&id=4322fd4f-8458-42ea-9414-8362e1dc636a&accountId=c110e2aa-322b-4f3f-a795-f441955844ed" \
     -H  'content-type: application/json' \
     -H  'x-qbit-access-token: db19fa75f4ed674135e26965173ff66f722684bb'
1
2
3

返回示例:

{
  "data": [
    {
      "id": "5abd4512-073f-43a0-a6e9-8378464f4e2f",
      "status": "Active",
      "name": "张三",
      "phone": "18668436517",
      "email": "1449681564@qq.com",
      "createTime": "2021-07-14T09:27:39.174Z"
    }
  ],
  "total": 1
}
1
2
3
4
5
6
7
8
9
10
11
12
13

Balance

balance

Balance 是所有账户在 Qbit 系统内金额,多种业务、多种币种会有不同的钱包

获取 Balance 列表

GET

/open-api/v1/balances

Headers:

Header Parameters 说明
x-qbit-access-token string access token
Content-Type application/json json 类型

GET 请求参数:

字段 类型 是否为必填 说明
id string id,查询多条以逗号隔开
limit number 默认 10 条
page number 默认 0
accountId string 客户 Id(默认将查询账户和子账户数据)
walletType string 余额类型
subAccount string 子账户 id

返回参数:

字段 类型 说明
data Balance[] Balance 对象的数组
total number 总数量

请求示例:

curl -X GET "https://global.service.staging.qbitnetwork.com/open-api/v1/balances?limit=10&page=0&id=4322fd4f-8458-42ea-9414-8362e1dc636a&accountId=c110e2aa-322b-4f3f-a795-f441955844ed" \
     -H  'content-type: application/json' \
     -H  'x-qbit-access-token: db19fa75f4ed674135e26965173ff66f722684bb'
1
2
3

返回示例:

{
  "data": [
    {
      "id": "5abd4512-073f-43a0-a6e9-8378464f4e2f",
      "accountId": "c110e2aa-322b-4f3f-a795-f441955844ed",
      "available": 100,
      "pending": 50,
      "frozen": 0,
      "currency": "USD",
      "createTime": "2021-07-14T09:27:39.174Z",
      "walletType": "QbitCard"
    }
  ],
  "total": 1
}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15