银行账户用作 off-ramp 交易(加密货币 → 法币)的目的地。KillB 支持拉丁美洲和美国的多个银行系统。
支持的银行账户类型
PSE(哥伦比亚)
通过 PSE 系统的哥伦比亚银行账户
哥伦比亚 - PSE 账户
{
"type": "PSE",
"userId": "user-id",
"externalId": "pse-account-1",
"data": {
"firstName": "Juan",
"lastName": "García",
"email": "[email protected]",
"phone": "+573001234567",
"accountNumber": "1234567890",
"bankCode": "0001",
"type": "savings",
"countryCode": "CO",
"document": {
"type": "NUIP",
"number": "1234567890",
"issuedCountryCode": "CO"
}
}
}
账户类型:
savings - 储蓄账户(Cuenta de Ahorros)
checking - 支票账户(Cuenta Corriente)
获取哥伦比亚银行
GET /api/v2/banks?countryCode=CO
[
{
"code": "0001",
"companyName": "Bancolombia",
"accountTypes": ["savings", "checking"]
},
{
"code": "0002",
"companyName": "Banco de Bogotá",
"accountTypes": ["savings", "checking"]
}
]
墨西哥 - SPEI 账户
{
"type": "SPEI",
"userId": "user-id",
"externalId": "spei-account-1",
"data": {
"firstName": "María",
"lastName": "López",
"email": "[email protected]",
"phone": "+525512345678",
"clabe": "012345678901234567",
"clabeType": "CLABE",
"countryCode": "MX",
"document": {
"type": "RFC",
"number": "LOMM920310ABC",
"issuedCountryCode": "MX"
}
}
}
CLABE 类型
18 位银行账户号码{
"clabe": "012345678901234567",
"clabeType": "CLABE"
}
银行转账最常见的格式。 16 位卡号{
"clabe": "1234567890123456",
"clabeType": "DEBIT_CARD",
"bankCode": "012"
}
需要 bankCode 字段。 10 位手机号码用于手机银行{
"clabe": "5512345678",
"clabeType": "PHONE_NUMBER",
"bankCode": "014"
}
需要 bankCode 字段。
获取墨西哥银行
GET /api/v2/banks?countryCode=MX
美国 - ACH 账户
{
"type": "ACH",
"userId": "user-id",
"externalId": "ach-account-1",
"data": {
"firstName": "John",
"lastName": "Smith",
"email": "[email protected]",
"phone": "+12125551234",
"bankName": "Chase Bank",
"routingNumber": "021000021",
"accountNumber": "123456789",
"type": "checking",
"countryCode": "US",
"document": {
"type": "SSN",
"number": "123-45-6789",
"issuedCountryCode": "US"
}
}
}
账户类型:
checking - 支票账户
savings - 储蓄账户
路由号码: 9 位 ABA 路由号码
电汇账户
用于国际电汇:
{
"type": "WIRE",
"userId": "user-id",
"externalId": "wire-account-1",
"data": {
"firstName": "Jane",
"lastName": "Doe",
"email": "[email protected]",
"phone": "+12125559876",
"accountNumber": "987654321",
"routingNumber": "021000021",
"bankName": "Bank of America",
"bankAddress": {
"street1": "100 Main St",
"city": "New York",
"stateCode": "NY",
"zipCode": "10001",
"countryCode": "US"
},
"countryCode": "US",
"document": {
"type": "SSN",
"number": "987-65-4321",
"issuedCountryCode": "US"
}
}
}
创建前验证账户详情:
const validatePSEAccount = (data) => {
const errors = [];
// 账户号码(10-20 位数字)
if (!/^\d{10,20}$/.test(data.accountNumber)) {
errors.push('账户号码格式无效');
}
// 银行代码(4 位数字)
if (!/^\d{4}$/.test(data.bankCode)) {
errors.push('银行代码无效');
}
// 账户类型
if (!['savings', 'checking'].includes(data.type)) {
errors.push('账户类型必须是 savings 或 checking');
}
return errors;
};
测试银行账户
在沙盒中,使用这些测试银行代码:
哥伦比亚:
0001 - Bancolombia
0002 - Banco de Bogotá
0003 - Davivienda
墨西哥:
012 - BBVA
014 - Santander
072 - Banorte
在沙盒中,任何账户号码格式都可以使用。使用真实的格式以获得更好的测试效果。
下一步