配置
获取国家列表
获取 VelaFi 支持的完整国家列表。可按有效状态筛选,仅返回有效国家或包含所有记录。
GET
/
v2
/
base
/
countrys
获取国家列表
curl --request GET \
--url https://api-test.velafi.com/v2/base/countrys \
--header 'X-BH-TOKEN: <api-key>'import requests
url = "https://api-test.velafi.com/v2/base/countrys"
headers = {"X-BH-TOKEN": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-BH-TOKEN': '<api-key>'}};
fetch('https://api-test.velafi.com/v2/base/countrys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://api-test.velafi.com/v2/base/countrys")
.header("X-BH-TOKEN", "<api-key>")
.asString();{
"code": 123,
"msg": "<string>",
"data": [
{
"country": "<string>",
"abbr": "<string>"
}
]
}使用 GET
/v2/base/countrys 接口获取 VelaFi 在入金、出金和全球支付服务中支持的所有国家。默认情况下,响应仅包含有效(启用)的国家;传入 hasFindAll=true 可获取包括未启用国家在内的完整列表。在构造需要 country 参数的后续请求时,请使用返回的 ISO 3166-1 代码。
请求
GET /v2/base/countrys
请求头
| 请求头 | 值 | 必填 |
|---|---|---|
X-BH-TOKEN | 通过 GET /v2/token/generate 获取的 token | ✓ |
查询参数
boolean
为
true 时,返回包括未启用国家在内的所有国家。默认为 false,仅返回有效(启用)的国家。响应字段
number
HTTP 风格的状态码。
200 表示成功。string
可读的状态信息,例如
"SUCCESS"。示例
curl --request GET \
--url 'https://api.velafi.com/v2/base/countrys' \
--header 'X-BH-TOKEN: YOUR_TOKEN'
curl --request GET \
--url 'https://api.velafi.com/v2/base/countrys?hasFindAll=true' \
--header 'X-BH-TOKEN: YOUR_TOKEN'
响应
{
"code": 200,
"msg": "SUCCESS",
"data": [
{
"country": "Mexico",
"abbr": "MX"
},
{
"country": "Argentina",
"abbr": "AR"
},
{
"country": "Brazil",
"abbr": "BR"
}
]
}
abbr 字段返回每个国家的 ISO 3166-1 alpha-2 代码。在任何需要 country 缩写的 API 请求中使用该值。⌘I
获取国家列表
curl --request GET \
--url https://api-test.velafi.com/v2/base/countrys \
--header 'X-BH-TOKEN: <api-key>'import requests
url = "https://api-test.velafi.com/v2/base/countrys"
headers = {"X-BH-TOKEN": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-BH-TOKEN': '<api-key>'}};
fetch('https://api-test.velafi.com/v2/base/countrys', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));HttpResponse<String> response = Unirest.get("https://api-test.velafi.com/v2/base/countrys")
.header("X-BH-TOKEN", "<api-key>")
.asString();{
"code": 123,
"msg": "<string>",
"data": [
{
"country": "<string>",
"abbr": "<string>"
}
]
}
