/get_accounts
Gets basic bank account names linked to user handle.
This will return a list of account names, along with basic account information, linked to the requested user handle. These are the accounts that were linked using the /link_account endpoint.
If you have been approved to pass account and routing numbers directly through the /link_account
, you need not poll this endpoint unless you have a failed transaction and want to investigate.
Requests
The request body at this endpoint is the get_accounts_msg JSON object.
Authorization / Authentication
Apps using Access Token Authorization
Use a valid access token in an Authorization: Bearer request header.
See Authenticating with an Access Token for more details.
Apps using ECDSA Authentication
Both authsignature
and usersignature
headers are required for this request. The usersignature header should be generated with a keypair registered to the user (either registered from the /register endpoint or the /register_wallet endpoint).
See the section on ECDSA Authentication for more detail about ECDSA signature generation.
Note - We recently renamed the field auth_handle
to app_handle
. For backward compatibility, auth_handle
is still valid but has been removed from our documentation.
POST /0.2/get_accounts HTTP/1.1
sandbox.silamoney.com
Content-Type: application/json
// if using OAuth2
Authorization: Bearer [GENERATED JWT TOKEN HERE]
// if using ECDSA
authsignature: [GENERATED AUTHSIGNATURE HEX STRING HERE]
usersignature: [GENERATED USERSIGNATURE HEX STRING HERE]
{
"header": {
"created": 1234567890,
"app_handle": "handle.silamoney.eth",
"user_handle":"user.silamoney.eth",
"version": "0.2",
"reference": "<your unique id>"
},
"message": "get_accounts_msg"
}
***
HTTP/1.1 200 OK
[
{
"account_number": "*1234",
"routing_number": "123456789",
"account_name": "default",
"account_type": "CHECKING",
"account_status": "active",
"active": true/false,
"account_link_status": "Plaid",
"match_score": 0.825,
"account_owner_name": "Test User",
"entity_name": "Test User",
"web_debit_verified":true
}
]
const res = await Sila.getAccounts(userHandle, walletPrivateKey);
// Success Response Object
console.log(res.statusCode); // 200
console.log(res.data[0].account_name); // Account name
console.log(res.data[0].account_number); // Account number
console.log(res.data[0].account_status); // Account status
console.log(res.data[0].account_type); // Account type
console.log(res.data[0].routing_number);
console.log(res.data[0].active);
console.log(res.data[0].account_link_status);
console.log(res.data[0].match_score);
console.log(res.data[0].account_owner_name);
console.log(res.data[0].entity_name);
console.log(res.data[0].web_debit_verified); // true/false
payload={
"user_handle": "user.silamoney.eth" #Required
}
User.getAccounts(silaApp,payload,user_private_key) # users_private_key (256 bits) associated with ethereum address
### Success Response Object
[
{
"account_number": "*1234",
"routing_number": "123456789",
"account_name": "default",
"account_type": "CHECKING",
"account_status": "active",
"active": true/false,
"account_link_status": "microdeposit_automatically_verified",
"match_score": 0.825,
"account_owner_name": "Test User",
"entity_name": "Test User",
"web_debit_verified":True
}
]
### Failure Response Object
{
status: 'FAILURE'
}
ApiResponse response = api.getAccounts("userHandle", "userPrivateKey");
// Success Response Object
System.out.println(response.getStatusCode()); // 200
System.out.println(((List<Account>) response.getData()).get(0).accountName); // Account name
System.out.println(((List<Account>) response.getData()).get(0).accountNumber); // Account Number
System.out.println(((List<Account>) response.getData()).get(0).accountStatus); // Account Status
System.out.println(((List<Account>) response.getData()).get(0).accountType); // Account Type
System.out.println(((List<Account>) response.getData()).get(0).accountListStatus); // Account Link Status.
System.out.println(((List<Account>) response.getData()).get(0).routingNumber);
System.out.println(((List<Account>) response.getData()).get(0).active);
System.out.println(((List<Account>) response.getData()).get(0).matchScore);
System.out.println(((List<Account>) response.getData()).get(0).accountOwnerName);
System.out.println(((List<Account>) response.getData()).get(0).entityName);
System.out.println(((List<Account>) response.getData()).get(0).getWebDebitVerified()); // true/false
$userHandle = 'user.silamoney.eth';
$userPrivateKey = 'some private key'; // Hex format
$response = $client->getAccounts($userHandle, $userPrivateKey);
// Success 200
echo $response->getStatusCode(); // 200
$accounts = $response->getData(); // Array of Silamoney\Client\Domain\Account
if (count($accounts)) {
echo $accounts[0]->accountName; // Account Name
echo $accounts[0]->accountNumber; // Account Number
echo $accounts[0]->accountStatus; // Account Status
echo $accounts[0]->accountType; // Account Type
echo $accounts[0]->matchScore; // Match Score
echo $accounts[0]->accountOwnerName; // Account Owner Name
echo $accounts[0]->entityName; // Entity Name
}
ApiResponse<object> response = api.GetAccounts(userHandle, walletPrivateKey);
// Success Object Response
Console.WriteLine(response.StatusCode); // 200
Console.WriteLine(((List<Account>)response.Data)[0].AccountLinkStatus); // Account Link Status
Console.WriteLine(((List<Account>)response.Data)[0].AccountName); // Account Name
Console.WriteLine(((List<Account>)response.Data)[0].AccountNumber); // Account Number
Console.WriteLine(((List<Account>)response.Data)[0].AccountStatus); // Account Status
Console.WriteLine(((List<Account>)response.Data)[0].AccountType); // Account Type
Console.WriteLine(((List<Account>)response.Data)[0].Active); // Active
Console.WriteLine(((List<Account>)response.Data)[0].RoutingNumber); // Routing Number
Console.WriteLine(((List<Account>)response.Data)[0].MatchScore); // Match Score
Console.WriteLine(((List<Account>)response.Data)[0].AccountOwnerName); // Account Owner Name
Console.WriteLine(((List<Account>)response.Data)[0].EntityName); // Entity Name
Console.WriteLine(((List<Account>)response.Data)[0].WebDebitVerified); // true
Key | Type | Description |
---|---|---|
header | JSON object | Required. Requires these keys in JSON format: created, app_handle, user_handle. See the /check_handle endpoint for the complete list of fields in this object. |
Responses
Status Code | Description |
---|---|
200 | Successfully fetched array of accounts. |
400 | Bad request format - check validation_details for more information. |
401 | authsignature or usersignature header was absent or incorrect. |
Response Contents
If the account is in one of the microdeposit pending link states, a record with
null
account and routing numbers will be returned.
Key | Datatype | Description |
---|---|---|
account_number | string or null | Masked bank account number, last 4 digits visible. |
routing_number | string or null | Bank account ACH routing number. |
account_name | string | Optional: Custom nickname assigned for each linked bank account which is displayed to end user (details here). |
account_type | string | Bank account subtype. |
account_status | string | Whether the account is "frozen". |
active | boolean | Whether the account is "frozen". |
account_link_status | string | Plaid or MX link status. |
match_score | string or null | Entity name match score with the account holder name |
account_owner_name | string | Account owner name from Plaid or MX. |
entity_name | string | Full name of the end-user. |
web_debit_verified | boolean | Account will have a new property which denotes if the account satisfies the “account validation” aspect of the Web Debit Rule. |
account_status
values:
active
inactive
account_link_status
values:
instantly_verified
microdeposit_automatically_verified
microdeposit_manually_verified
microdeposit_pending_automatic_verification
microdeposit_pending_manual_verification
verification_expired
Fuzzy Name Match and the
/get_accounts
response bodyWithin the response body of
/get_accounts
you will see the values:
"match_score": 0.825,
"account_owner_name": "Test User",
"entity_name": "Test User"
The account owner name is the name on the account provided by Plaid or MX, while the entity name is the name of the person or business as provided to Sila through your request to
/register
.These two names need to closely match otherwise the account will not be useable. If the match score is less than 0.73 the account will be frozen and not useable.
Steps to unfreezing a linked account can be found HERE
Updated 3 months ago