全球账户
创建全球账户
POST
/open-api/v1/global/accounts
Headers:
Header | Parameters | 说明 |
---|---|---|
x-qbit-access-token | string | access token |
Content-Type | application/json | json 类型 |
POST 请求参数:
字段 | 类型 | 是否为必填 | 说明 |
---|---|---|---|
accountId | string | 是 | 账户 ID |
currency | string | 是 | 币种 |
purpose | string | 是 | 用途 |
nickname | string | 否 | 账户昵称 |
返回参数:
字段 | 类型 | 说明 |
---|---|---|
data | Boolean | Boolean |
获取全球账户列表
GET
/open-api/v1/global/accounts
Headers:
Header | Parameters | 说明 |
---|---|---|
x-qbit-access-token | string | access token |
Content-Type | application/json | json 类型 |
GET 请求参数:
字段 | 类型 | 是否为必填 | 说明 |
---|---|---|---|
accountId | string | 是 | 账户 ID |
id | string | 否 | id |
limit | number | 否 | 默认 10 条 |
page | number | 否 | 默认 0 |
currency | string | 否 | 币种 |
返回参数:
字段 | 类型 | 说明 |
---|---|---|
data | GlobalSubAccount[] | GlobalSubAccount 的数组 |
total | number | 总数量 |
获取银行账户列表
GET
/open-api/v1/global/accounts/banks
Headers:
Header | Parameters | 说明 |
---|---|---|
x-qbit-access-token | string | access token |
Content-Type | application/json | json 类型 |
GET 请求参数:
字段 | 类型 | 是否为必填 | 说明 |
---|---|---|---|
accountId | string | 是 | 账户 ID |
id | string | 否 | id |
limit | number | 否 | 默认 10 条 |
page | number | 否 | 默认 0 |
currency | string | 否 | 币种 |
globalSubAccountId | string | 是 | 全球账户 Id |
返回参数:
字段 | 类型 | 说明 |
---|---|---|
data | BankAccounts[] | BankAccounts 的数组 |
total | number | 总数量 |
请求示例:
curl -X GET "https://global.service.staging.qbitnetwork.com/open-api/v1/global/accounts/banks?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'
2
3
返回示例:
{
"data": [
{
"id": "e01844db-9790-432e-86f9-da2ed0675367",
"accountId": "dd7774c1-e9a2-4942-921d-f6909cc8fa68",
"createTime": "2020-12-31 10:10:10",
"accountName": "QBIT TEST",
"accountNo": "0337341484",
"currency": "USD",
"bankName": "Community Federal Savings Bank",
"bankAddress": "810 Seventh Avenue, New York, NY 10019, US",
"swift": "",
"routingNumber": "026073008",
"routingType": "WIRE",
"status": "Active",
"balanceId": "e01844db-9790-432e-86f9-da2ed0675367"
},
{
"id": "e01844db-9790-432e-86f9-da2ed0675367",
"accountId": "dd7774c1-e9a2-4942-921d-f6909cc8fa68",
"createTime": "2020-12-31 10:10:10",
"accountName": "QBIT TEST",
"accountNo": "0337341484",
"currency": "USD",
"bankName": "Community Federal Savings Bank",
"bankAddress": "810 Seventh Avenue, New York, NY 10019, US",
"swift": "TCCLGB3L",
"routingNumber": "TCCLGB3L",
"routingType": "BIC_SWIFT",
"status": "Active",
"balanceId": "e01844db-9790-432e-86f9-da2ed0675367"
}
],
"total": 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
26
27
28
29
30
31
32
33
34
35
创建受益人
说明: 创建受益人的字段相对复杂,除以下文档必填字段外,剩余字段需要按照《收款人说明文档》 (opens new window)(密码:qiq1)来确定是否必填
POST
/open-api/v1/global/beneficiaries
Headers:
Header | Parameters | 说明 |
---|---|---|
x-qbit-access-token | string | access token |
Content-Type | application/json | json 类型 |
POST 请求参数:
字段 | 类型 | 是否为必填 | 说明 |
---|---|---|---|
accountId | string | 是 | 账户 ID |
firstName | string | 否 | 名 |
lastName | string | 是 | 姓 、企业全名 |
currency | string | 是 | 币种 |
accountNumber | string | 否 | 收款方银行账户 |
relationship | enum | 是 | 收款方与此账户关系 |
receiverAddress | json | 否 | 收款为个人时,为个人地址, 收款为公司时,为收款公司地址(通用地址) |
bankAddress | json | 否 | 银行地址(通用地址) |
bankName | string | 否 | 银行名称 |
type | string | 否 | 账户类型(对公、对私)(CNY) |
bankBranchName | string | 否 | 银行支行名称(CNY) |
certificateNo | string | 否 | 证件号(CNY)-个人证件号、企业统一社会信用代码 |
bic | string | 否 | bic_swift |
iban | string | 否 | iban(EUR) |
routingNumber | string | 否 | 收款路线号码 |
routingNumber2 | string | 否 | 收款路线号码 2 |
返回参数:
字段 | 类型 | 说明 |
---|---|---|
data | Beneficiary | 收款人 |
请求示例:
curl -X POST \
https://global.service.staging.qbitnetwork.com/open-api/v1/global/beneficiaries \
-H 'content-type: application/json' \
-H 'x-qbit-access-token: db19fa75f4ed674135e26965173ff66f722684bb' \
-d '{
"accountId": "4806862e-d8da-4648-9718-e7d571fd8de9",
"lastName": "test",
"currency": "USD",
"accountNumber": "1655783758",
"receiverAddress": {
"addressLine1": "tongluowan",
"addressLine2": "",
"city": "HK",
"country": "HK",
"postalCode": "000000",
"state": "HK"
},
"bankAddress": {
"addressLine1": "",
"addressLine2": "",
"city": "",
"country": "US",
"postalCode": "",
"state": ""
},
"bankName": "BBK",
"type": "Business",
"bic": "BBKUBHBMBUD",
"routingType": "aba",
"routingNumber": "026073008",
"routingNumber2": "026073150",
"relationship": "SAME_ACCOUNT"
}'
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
返回示例:
{
"code": 0,
"message": "ok",
"data": [
{
"id": "2510ab47-7068-4a69-8157-091667605651",
"currency": "USD",
"userName": "test",
"accountNumber": "1655783758",
"receiverAddress": {
"addressLine1": "tongluowan",
"addressLine2": "",
"city": "HK",
"country": "HK",
"postalCode": "000000",
"state": "HK"
},
"bankAddress": {
"addressLine1": "",
"addressLine2": "",
"city": "",
"country": "US",
"postalCode": "",
"state": ""
},
"bankName": "BBK",
"type": "Business",
"bic": "BBKUBHBMBUD",
"routingType": "aba",
"routingNumber": "026073008",
"routingNumber2": "026073150"
}
]
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
获取受益人列表
GET
/open-api/v1/global/beneficiaries
Headers:
Header | Parameters | 说明 |
---|---|---|
x-qbit-access-token | string | access token |
Content-Type | application/json | json 类型 |
GET 请求参数:
字段 | 类型 | 是否为必填 | 说明 |
---|---|---|---|
accountId | string | 是 | 账户 ID |
id | string | 否 | id |
limit | number | 否 | 默认 10 条 |
page | number | 否 | 默认 0 |
currency | string | 否 | 币种 |
返回参数:
字段 | 类型 | 说明 |
---|---|---|
data | Beneficiary[] | Beneficiary 的数组 |
total | number | 总数量 |
请求示例:
curl -X GET "https://global.service.staging.qbitnetwork.com/open-api/v1/global/beneficiaries" \
-H 'content-type: application/json' \
-H 'x-qbit-access-token: db19fa75f4ed674135e26965173ff66f722684bb'
2
3
返回示例:
{
"data": [
{
"id": "085df21e-e8f3-4b33-a840-9780299d0cb4",
"currency": "USD",
"userName": "global-receiver-3",
"accountNumber": "12345678",
"receiverAddress": {
"addressLine1": "111",
"addressLine2": "222",
"city": "new york",
"state": "1",
"country": "US",
"postalCode": "123456"
},
"bankName": "Test Bank Name",
"bankAddress": {
"addressLine1": "111",
"addressLine2": "222",
"city": "new york",
"state": "1",
"country": "US",
"postalCode": "123456"
},
"bankBranchName": "",
"certificateNo": "",
"routingType": "aba",
"routingNumber": "026013576",
"bic": "HSBCCNSH",
"iban": ""
}
],
"pageTotal": 1,
"total": 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
26
27
28
29
30
31
32
33
34
35
获取汇率
Tips: 美国节假日和双休时间不可用
POST
/open-api/v1/global/exchange_rates
Headers:
Header | Parameters | 说明 |
---|---|---|
x-qbit-access-token | string | access token |
Content-Type | application/json | json 类型 |
POST 请求参数:
字段 | 类型 | 是否为必填 | 说明 |
---|---|---|---|
accountId | string | 是 | 账户 ID |
sellCurrency | string | 是 | 卖出币种 |
buyCurrency | string | 是 | 买入币种 |
返回参数:
字段 | 类型 | 说明 |
---|---|---|
data | ExchangeRate | 手续费明细 |
ExchangeRate模型
字段 | 类型 | 说明 |
---|---|---|
pair | string | 交易对 |
rate | string | 汇率(为'0'时,说明汇率暂不可用或者不支持此币种) |
exchangeRateId | string | 汇率 ID |
请求示例:
curl -X POST \
https://global.service.staging.qbitnetwork.com/open-api/v1/global/payment/fee \
-H 'content-type: application/json' \
-H 'x-qbit-access-token: db19fa75f4ed674135e26965173ff66f722684bb' \
-d '{
"sellCurrency": "USD",
"buyCurrency": "EUR",
"accountId": "ace01929-2ba4-41b5-bfff-17c00c0b969b"
}'
2
3
4
5
6
7
8
9
返回示例:
{
"code": 0,
"message": "ok",
"data": {
"pair": "USDEUR",
"rate": "0.8390",
"exchangeRateId": "ef5beaa2-2960-4f80-a246-3a1fe89731fb"
}
}
2
3
4
5
6
7
8
9
创建付款订单
POST
/open-api/v1/global/payment
Headers:
Header | Parameters | 说明 |
---|---|---|
x-qbit-access-token | string | access token |
Content-Type | application/json | json 类型 |
POST 请求参数:
字段 | 类型 | 是否为必填 | 说明 |
---|---|---|---|
accountId | string | 是 | 账户 ID |
balanceId | string | 是 | 出款 BankAccount 的余额 id |
receiverId | string | 是 | 收款人 ID |
amount | number | 是 | 付款金额金额 |
clientTransactionId | string | 是 | Client 交易 id(方便关联订单) |
reference | string | 是 | 付款备注 |
transferType | TransferType | 否 | 付款方式 (不填系统会默认判断) |
feeType | FeeType | 否 | 手续费收费模式(只对国际付款有效) |
purposeCode | PurposeCode | 否 | 付款目的代码(马来西亚币种付款必填) |
exchangeRateId | string | 否 | 汇率 ID (换汇付款时必填) |
realPaymentAmount | number | 否 | 换汇付款里的实际到账金额 (指定时需要配合 exchangeRateId 使用) |
shopType | ShopType | 否 | 结汇类型, 结汇付款必填 |
transferType可能的值为:
- Local(使用本地网络付款)
- International(使用 SWIFT 网络付款)
feeType可能的值为:
- SHA(双方共同承担)
- OUR(付款方支付)
purposeCode可能的值为:
Code | 类型 |
---|---|
advertising | Advertising and public relations-related expenses |
advisor_fees | Fees for advisory, technical, academic or specialist assistance |
business_insurance | Product indemnity insurance |
construction | Construction costs/expenses |
delivery | Delivery fees for goods |
education | Education-related student expenses |
exports | Payments for exported goods |
family | Family maintenance |
fund_investment | Mutual fund investment |
homesend | Homesend Payments |
hotel | Hotel accommodation |
insurance_claims | Insurance claims payment |
insurance_premium | Insurance premium |
loan_repayment | Repayment of loans |
medical | Medical treatment and expenses |
office | Representative office expenses |
other_fees | Broker, front end, commitment, guarantee and custodian fees |
property_purchase | Purchase of residential property |
property_rental | Property rental payment |
royalties | Royalty, trademark, patent and copyright fees |
services | Information service charges |
share_investment | Investment in shares |
tax | Tax payment |
transfer | Transfer to own account |
transportation | Transportation fees for goods |
travel | Travel |
utilities | Utility bills |
shopType可能的值为:
- PLATFORM(电商)
- B2B(B2B)
- OTHER(其他)
返回参数:
字段 | 类型 | 说明 |
---|---|---|
data | boolean | 付款是否提交 |
请求示例:
curl -X POST \
https://global.service.staging.qbitnetwork.com/open-api/v1/payment \
-H 'content-type: application/json' \
-H 'x-qbit-access-token: db19fa75f4ed674135e26965173ff66f722684bb' \
-d '{
"clientTransactionId": "32adc941-dcb2-401a-8fa5-5eda067f6c4f",
"receiverId": "f84257d6-2a43-4460-9371-cdf2b0da25df",
"balanceId": "9495e621-e525-44a1-b4d8-415ce44e5c6b",
"amount": 20,
"reference": "",
"transferType": "International",
"feeType": "OUR"
}'
2
3
4
5
6
7
8
9
10
11
12
13
返回示例:
{
"code": 0,
"message": "ok",
"data": true
}
2
3
4
5
创建批量付款订单
POST
/open-api/v1/global/payment/batch
Headers:
Header | Parameters | 说明 |
---|---|---|
x-qbit-access-token | string | access token |
Content-Type | application/json | json 类型 |
POST 请求参数:
字段 | 类型 | 是否为必填 | 说明 |
---|---|---|---|
paymentList | json 数组 | 是 | 批量付款的列表 |
payments 是一个 数组,单个结构和单个付款比较类似,单个结构如下。
{
"accountId": "c86c1860-b60f-44f4-b9af-acdf066dd459",
"clientTransactionId": "32adc941-dcb2-401a-8fa5-5eda067f6c4f",
"receiverId": "f84257d6-2a43-4460-9371-cdf2b0da25df",
"balanceId": "9495e621-e525-44a1-b4d8-415ce44e5c6b",
"amount": 20,
"reference": "",
"transferType": "LOCAL",
"feeType": "OUR"
}
2
3
4
5
6
7
8
9
10
返回参数:
字段 | 类型 | 说明 |
---|---|---|
data | boolean | 批量付款订单是否提交 |
请求示例:
curl -X POST \
https://global.service.staging.qbitnetwork.com/open-api/v1/global/payment/batch \
-H 'content-type: application/json' \
-H 'x-qbit-access-token: db19fa75f4ed674135e26965173ff66f722684bb' \
-d '{
"paymentList": [
{
"accountId": "c86c1860-b60f-44f4-b9af-acdf066dd459",
"clientTransactionId": "43dcd21d-7417-47e5-bb60-2126e40fad52",
"receiverId": "f84257d6-2a43-4460-9371-cdf2b0da25df",
"balanceId": "9495e621-e525-44a1-b4d8-415ce44e5c6b",
"amount": 20,
"reference": "",
"transferType": "LOCAL",
"feeType": "OUR"
}
]
}'
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
返回示例:
{
"code": 0,
"message": "ok",
"data": true
}
2
3
4
5
获取付款订单手续费
POST
/open-api/v1/global/payment/fee
Headers:
Header | Parameters | 说明 |
---|---|---|
x-qbit-access-token | string | access token |
Content-Type | application/json | json 类型 |
POST 请求参数:
字段 | 类型 | 是否为必填 | 说明 |
---|---|---|---|
accountId | string | 是 | 账户 ID |
balanceId | string | 是 | 出款 BankAccount 的余额 id |
receiverId | string | 是 | 收款人 ID |
amount | number | 是 | 付款金额金额 |
feeType | FeeType | 否 | 手续费模式 |
transferType | TransferType | 否 | 付款方式 (不填系统会默认判断) |
shopType | ShopType | 否 | 结汇类型, 结汇付款必填 |
返回参数:
字段 | 类型 | 说明 |
---|---|---|
data | TransactionFee | 手续费明细 |
TransactionFee模型
字段 | 类型 | 说明 |
---|---|---|
fee | number | 手续费 |
total | number | 总付款金额 |
请求示例:
curl -X POST \
https://global.service.staging.qbitnetwork.com/open-api/v1/global/payment/fee \
-H 'content-type: application/json' \
-H 'x-qbit-access-token: db19fa75f4ed674135e26965173ff66f722684bb' \
-d '{
"accountId": "ace01929-2ba4-41b5-bfff-17c00c0b969b",
"receiverId": "21b5dcfe-a34d-4528-a512-ac553753943a",
"balanceId": "7284eccc-f066-4aa6-b124-6f7b83b08bcd",
"amount": 100
}'
2
3
4
5
6
7
8
9
10
返回示例:
{
"code": 0,
"message": "ok",
"data": {
"total": 102,
"fee": 2
}
}
2
3
4
5
6
7
8
获取交易列表
GET
/open-api/v1/global/transactions
Headers:
Header | Parameters | 说明 |
---|---|---|
x-qbit-access-token | string | access token |
Content-Type | application/json | json 类型 |
GET 请求参数:
字段 | 类型 | 是否为必填 | 说明 |
---|---|---|---|
accountId | string | 是 | 账户 ID |
id | string | 否 | id |
limit | number | 否 | 默认 10 条 |
page | number | 否 | 默认 0 |
currency | string | 否 | 币种 |
clientTransactionId | string | 否 | client 交易 id |
返回参数:
字段 | 类型 | 说明 |
---|---|---|
data | GlobalAccountTransaction[] | GlobalAccountTransaction 的数组 |
total | number | 总数量 |
请求示例:
curl -X GET "https://global.service.staging.qbitnetwork.com/open-api/v1/global/transactions" \
-H 'content-type: application/json' \
-H 'x-qbit-access-token: db19fa75f4ed674135e26965173ff66f722684bb'
2
3
返回示例:
{
"code": 0,
"message": "ok",
"data": {
"data": [
{
"id": "2174e191-3554-49a9-a891-6bcac1b143c5",
"accountId": "fc91fece-f8e2-43d9-a70b-a1bddebc399c",
"currency": "USD",
"settlementCurrency": "USD",
"counterparty": "QbitPay",
"transactionAmount": 10,
"fee": 36,
"businessType": "Outbound",
"status": "Pending",
"transactionTime": "2021-11-18T07:23:42.096Z",
"transactionId": "f2646616-930c-4259-92ea-064e6d870a21",
"clientTransactionId": "dd7774c1-e9a2-14942-921d-f6909cc8fa61",
"createTime": "2021-11-18T07:23:42.096Z"
},
{
"id": "78d20145-36bf-453e-8b41-d92bf516074c",
"accountId": "fc91fece-f8e2-43d9-a70b-a1bddebc399c",
"currency": "USD",
"settlementCurrency": "USD",
"counterparty": "QbitPay",
"transactionAmount": 10,
"fee": 36,
"businessType": "Outbound",
"status": "Pending",
"transactionTime": "2021-11-18T07:22:39.420Z",
"transactionId": "e27828db-bc9d-425f-aef2-af714de560c1",
"clientTransactionId": "dd7774c1-e9a2-14942-921d-f6909cc8fa68",
"createTime": "2021-11-18T07:22:39.420Z"
}
],
"pageTotal": 2,
"total": 2
}
}
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
← 量子卡 WebHook 推送 →