Sila API Docs | Sila Banking and Payments API

Welcome to the Sila API!

/link_account

Links a bank account to a verified entity, either with a Plaid public token or with account/routing numbers.

🚧

In July 2020, Plaid introduced link_token which is not yet supported. Visit Plaid - Maintain Legacy Integrations to learn more.

This endpoint accepts results from customer interaction with a Plaid Link integration. (If you have been approved for linking account and routing numbers directly, you can instead pass account and routing numbers to this endpoint - email us for details.)

At a minimum, your frontend Plaid integration will need to:

  • use a public key from Sila. For all environments (sandbox, development and production), please use the same public key:
  • fa9dd19eb40982275785b09760ab79
  • be set to the "sandbox" environment for sandbox apps, and the "production" environment for production apps.
  • use the "auth" product from Plaid.
    The onSuccess() function of the Plaid plugin will return a public token and metadata object to your code. Please use our API to send us the public token, and we will query the routing number and account number of the bank account from Plaid and store it securely on our systems.

📘

Note: For 100% coverage of all supported institutions, we strongly recommend passing additional parameters when creating the Plaid Link interface to enable microdeposit verification. This configuration is provided in detail in the following sections of this documentation.

  

Plaid Link Integration Quickstart

Plaid Link Integration Quickstart

In the sandbox, you will be using the public_key provided by Sila to connect with Plaid via Legacy Integrations

fa9dd19eb40982275785b09760ab79

In the sandbox, you can test bank account linking with any bank that shows up in the Plaid Link interface, and specify the username as "user_good", and the password as "pass_good".

See Also:
Maintaining Legacy Integration for iOS

Maintaining Legacy Integration for Android

  

Requests

POST /0.2/link_account HTTP/1.1
Host: sandbox.silamoney.com
authsignature: [GENERATED AUTHSIGNATURE HEX STRING HERE]
usersignature: [GENERATED USERSIGNATURE HEX STRING HERE]
Content-Type: application/json

{
  "header": {
    "created": 1234567890, 
    "auth_handle": "handle.silamoney.eth", 
    "user_handle":"user.silamoney.eth", 
    "version": "0.2", 
    "crypto": "ETH", 
    "reference": "ref"
  }, 
  "message": "link_account_msg",
  "public_token": "public-xxx-xxx",
  "account_name": "Custom Account Name",
  "selected_account_id": "optional_selected_account_id"
}

***

HTTP/1.1 200 OK

{
  "success": true,
  "status": "SUCCESS",
  "reference": "ref",
  "message": "Bank account successfully linked.",
  "account_name: "Custom Account Name",
  "match_score": 0.825,
}

***
***

POST /0.2/link_account HTTP/1.1
Host: sandbox.silamoney.com
authsignature: [GENERATED AUTHSIGNATURE HEX STRING HERE]
usersignature: [GENERATED USERSIGNATURE HEX STRING HERE]
Content-Type: application/json

{
  "header": {
    "created": 1234567890, 
    "auth_handle": "handle.silamoney.eth", 
    "user_handle":"user.silamoney.eth", 
    "version": "0.2", 
    "crypto": "ETH", 
    "reference": "ref"
  }, 
  "message": "link_account_msg",
  "account_number": "123456789012",
  "routing_number": "123456789",
  "account_type": "CHECKING",
  "account_name": "Custom Account Name",
}

***

HTTP/1.1 200 OK

{
  "success": true,
  "status": "SUCCESS",
  "reference": "ref",
  "message": "Bank account successfully linked.",
  "account_name: "Custom Account Name",
  "match_score": null,
}
// Plaid verification flow (recomended)
const res = await Sila.linkAccount(
  userHandle,
  walletPrivateKey,
  token,
  accountName,
  accountId,
); // Account Name and Account Id parameters are not required


//Public token received in the /link/item/create plaid endpoint.

// Direct account-linking flow (restricted by use-case, contact Sila for approval)
const res = await Sila.linkAccountDirect(
  userHandle,
  walletPrivateKey,
  accountNumber,
  routingNumber,
  accountName,
  accountType,
); // Account Type and Account Name parameters are not required

//The only permitted account type is "CHECKING"

// Success Response Object
console.log(res.statusCode); // 200
console.log(res.data.reference); // Random reference number
console.log(res.data.status); // SUCCESS
console.log(res.data.message); // Bank account successfully linked
### Link Account with Plaid
payload = {
    "public_token": "public-development-0dc5f214-56a2-4b69-8968-f27202477d3f",  # Required token from plaid
    "user_handle": "user.silamoney.eth"                                         # Required
    "account_name": "Custom Account Name"                                       # Optional (default value is "default")
}

User.linkAccount(silaApp, payload, user_private_key, plaid=True)

### Link Account with Direct Account Linking
payload={
            "user_handle": "user.silamoney.eth",    # Required
            "account_number": "123456789012",       # Required
            "routing_number": "123456789",          # Required
            "account_type": "CHECKING",             # Optional (default value is CHECKING)
            "account_name": "Custom Account Name"   # Optional (default value is "default")
        }

User.linkAccount(silaApp,payload,user_private_key)

### Success Response Object
{
    status: 'SUCCESS'
}

### Failure Response Object
{
    status: 'FAILURE'
}
ApiResponse response = api.LinkAccount(userHandle, accountName, publicToken, userPrivateKey); 

***Public token received in the /link/item/create plaid endpoint.***

##### Success Response Object

System.out.println(response.getStatusCode()); // 200
LinkAccountResponse parsedResponse = (LinkAccountResponse) response.getData();
System.out.println(parsedResponse.getStatus()); // SUCCESS
System.out.println(parsedResponse.getReference()); // Reference number
System.out.println(parsedResponse.getMessage()); // Successfully linked
System.out.println(parsedResponse.getAccountName()); // Your desired account name
System.out.println(parsedResponse.getMatchScore()); // Match score
//**Public token received in the /link/item/create endpoint: https://plaid.com/docs/#integrating-with-link **

// SANDBOX ONLY: You can generate a testing public token instead of using the Plaid Link plugin with:
$client = new \GuzzleHttp\Client(["base_uri" => "https://sandbox.plaid.com"]);
$options = [
    'json' => [
        "public_key" => "fa9dd19eb40982275785b09760ab79",
        "initial_products" => ["transactions"],
        "institution_id" => "ins_109508",
        "credentials" => [
            "username" => "user_good",
            "password" => "pass_good"
        ]
    ]
];
$response = $client->post('/link/item/create', $options);
$content = json_decode($response->getBody()->getContents());
$public_token = $content->public_token;             // Public Token to pass to linkAccount()
$account_id = $content->accounts[0]->account_id;    // Optional Account ID to pass to linkAccount()

####
//**IMPORTANT!** If you do not specify an `$account_id` in `linkAccount()`, the first account returned by Plaid will be linked by default.
####

## Plaid token flow
// Load your information
$userHandle = 'user.silamoney.eth';
$accountName = 'Custom Account Name';   // Defaults to 'default'
$publicToken = 'public-xxx-xxx';        // A temporary token returned from the Plaid Link plugin. See above for testing.
$accountId = 'string';                  // Recommended but not required. See note above.
$userPrivateKey = 'some private key';   // The private key used to register the specified user

// Call the api
$response = $client->linkAccount($userHandle, $userPrivateKey, $publicToken, $accountName, $accountId);

## Direct Link account
// Load your information
$userHandle = 'user.silamoney.eth';
$accountName = 'Custom Account Name';   // Defaults to 'default' if not provided. (not required)
$routingNumber = '123456789';           // The routing number. 
$accountNumber = '123456789012';        // The bank account number
$userPrivateKey = 'some private key';   // The private key used to register the specified user
$accountType = 'CHECKING';              // The account type (not required). Only available value is CHECKING

// Call the api
$response = $client->linkAccountDirect($userHandle, $userPrivateKey, $accountNumber, $routingNumber, $accountName, $accountType);

### Success 200
echo $response->getStatusCode();        // 200
echo $response->getData()->getStatus(); // SUCCESS
// Public token received in the /link/item/create plaid endpoint.

ApiResponse<object> response = api.LinkAccount(userHandle, publicToken, walletPrivateKey, accountName, accountId); // Account Name and Account Id parameters are not required

// Direct account-linking flow (restricted by use-case, contact Sila for approval)

ApiResponse<object> response = api.LinkAccountDirect(userHandle, walletPrivateKey, accountNumber, routingNumber, accountType, accountName); // Account Type and Account Name parameters are not required 

// The only permitted account type is "CHECKING"

// Success Response Object

```csharp
Console.WriteLine(response.StatusCode); // 200
Console.WriteLine(((LinkAccountResponse)response.Data).Reference); // Random reference number
Console.WriteLine(((LinkAccountResponse)response.Data).Status); // SUCCESS
Console.WriteLine(((LinkAccountResponse)response.Data).Message); // Bank account successfully linked.
Console.WriteLine(((LinkAccountResponse)response.Data).AccountName); // Account Name.
Console.WriteLine(((LinkAccountResponse)response.Data).MatchScore);

Key

Type

Description

header

JSON object

Required. Requires these keys in JSON format: created, auth_handle, user_handle. See the /check_handle endpoint for the complete list of fields in this object.

public_token

String

Required if not setting accou ntnumber and routing_number. Enter a valid token from Plaid Link flow consisting of letters, numbers, underscores, or hyphens.
This value should be match the required regex pattern: ^[-a-zA-Z0-9
]+$ Example: public-xxx-xxx

account_name

String

Optional. Min length 1, Max length 40, default value if not sent in request is “default” Example: Custom Account Name

selected_account_id

String

Optional. Optional Plaid account ID from list of selected account IDs returned from Plaid Link flow.
If not specified, Sila will link the first checking account listed as belonging to the user’s institution.
Max Length 100

account_number

String

Required if not setting public_token. Min Length 1, Max 17
This value should match the required regex pattern: ^[0-9]+$ If there is no public_token, the account number is required. Example: 123456789012

routing_number

String

Required if not setting public_token. Min Length 9, Max 9
This value should match the required regex pattern: ^[0-9]+$ If there is no public_token then routing number is required. Example: 123456789

account_type

String

Optional. UPPER-CASE, only valid value is CHECKING. If not specified, account type is assumed to be CHECKING.
Max Length 10
Example: CHECKING

  

The request body at this endpoint is the link_account_msg JSON object.

Both authsignature and usersignature headers are required for this request.

The account_name key is not required, but can be used to set a custom name to identify the linked checking account. If not provided, the linked account's name will be "default". We highly recommend specifying a custom name. Note: user handles cannot have two linked accounts with the same name.

  

For customers using our Plaid verification flow (recommended)

The public_token key is a required field and must have the public token returned in the onSuccess function of Plaid Link.

The selected_account_id is not required; if provided, it should be an account ID in the array of selected accounts returned in the metadata object from Plaid Link. Currently, we do not link multiple accounts at once; you will need to send only one account ID. If no account ID is provided, we will link the first checking account we encounter from the array of accounts the customer has at their chosen bank.

  

For customers using our direct account-linking flow

(restricted by use-case, contact Sila for approval):

The account_type is not required; the only account type we currently support linking is a "CHECKING" account.

The account_number is required. Must be all numeric character and no longer than 17 characters.

The routing_number is required. Must be numeric and exactly 9 characters long.

  

Responses

Status Code

success Attribute

Description

200

true

Bank account successfully linked.

200

false

Bank account not successfully linked (public token may have expired; tokens expire in 30 minutes after creation).

202

false

Bank account linked, but in a frozen state. Requires manual review - email [email protected] for steps to unfreeze this bank account.

400

false

Bad request format - check validation_details for more information.

401

false

authsignature or usersignature header was absent or incorrect.

Updated 2 days ago


/link_account


Links a bank account to a verified entity, either with a Plaid public token or with account/routing numbers.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.