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 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 is a JavaScript wrapper that uses Promises which makes it easy for you to handle the asynchronous, external account requests made to our API. See the full documentation here.

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

Getting the SDK

Using npm you can get the SDK with

npm install --save bond-sdk-web

or via our CDN.

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/web/v1/bond-sdk-web.js"></script>

or using node.js

import { BondExternalAccounts } from 'bond-sdk-web';

Initializing the Bond account connection

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

const bondExternalAccounts = new BondExternalAccounts({ live: false });

passing { live: true } if using the live environment.

Linking an external account

The following code is an example of using the SDK to link an external account for a customer,

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

and

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

for a business.

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({
    linkedAccountId: "LINKED_ACCOUNT_ID",
    identity: "TEMP_IDENTITY_TOKEN",
    authorization: "TEMP_AUTH_TOKEN",
  })
  .then(data => {
    // code...
  })
  .catch(error => {
    // code...
  });

Deleting linked external accounts

The following code is an example of using the SDK to delete linked external accounts.

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

More information

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


Did this page help you?