Linking external accounts SDK

How to use the Bond external accounts SDK to link a card account to an external account.

Overview

The linking external accounts SDK provided by Bond Studio allows you to create an application that acts as a building block for your software solution when you need to interact with a customer's external account. For example, without having to write the code yourself, you can use the SDK to:

  • Link to an external account.
  • Make micro-deposits to verify the account.

The accounts API allows you to link a customer's Bond card to their verified external bank account. The customer can then transfer funds back and forth between their card account and the linked external account. Once the link is established, we use the linked_account_id identifier to represent the customer's external account.

The linking external account SDK provided by Bond Studio is a Javascript wrapper that uses Promises which makes it easy for you to handle the asynchronous, external account requests made to our API.

The SDK provides a BondExternalAccounts object that contains several methods that map to the calls and parameters described in the Linking accounts API documentation.

Getting the SDK

Download the external accounts SDK from here.

Using the SDK

Listed below are some examples of how to use the SDK for external accounts.

Import script example

The following "import-scripts" code is a generic example of how you can use the SDK.

<script src="https://cdn.plaid.com/link/v2/stable/link-initialize.js"></script>
<script src="https://cdn.bond.tech/sdk/external-accounts/v1/bond-sdk-external-accounts.js"></script>

Initializing the Bond account connection

The following code is an example of using the SDK to initialize BondAccountConnection.

const bondExternalAccounts = new BondExternalAccounts({ bondEnv: 'api', plaidEnv: 'production' });

Linking an external account

The following code is an example of using the SDK to link an external account.

bondExternalAccounts
  .linkAccount({
    accountId: "ACCOUNT_ID",
    identity: "TEMP_IDENTITY_TOKEN",
    authorization: "TEMP_AUTH_TOKEN",
  })
  .then(data => {
    // code...
  })
  .catch(error => {
    // code...
  });

For details, see Linking external accounts.

Making micro deposits

The following code is an example of using the SDK to make micro deposits.

bondExternalAccounts
  .microDeposit({
    accountId: "ACCOUNT_ID",
    linkedAccountId: "LINKED_ACCOUNT_ID",
    identity: "TEMP_IDENTITY_TOKEN",
    authorization: "TEMP_AUTH_TOKEN",
  })
  .then(data => {
    // code...
  })
  .catch(error => {
    // code...
  });

For a complete specification and interactive examples, see Linking external accounts in the Bond API Reference.


Did this page help you?