Plaid Link

Plaid Link allows users to quickly verify bank accounts through instant account verification (IAV). If Moov is managing your Plaid relationship, you can use Moov.js to link bank accounts with Plaid. Once you have a signed contract with Moov, you can work with Moov’s customer success team to prepare your account for Plaid.

Initialize Moov.js

As with all Moov.js methods, you will need a Moov access token with the appropriate scopes.

The Moov.js Plaid functions require the following scopes:

  • /accounts/{accountID}/bank-accounts.write
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
<head>
  <script src="https://js.moov.io/v1"></script>
</head>
<body>
  <script>
    fetch( ... ) // Use your server to get a Moov access token with the appropriate scopes
    .then((moovAccessToken) => {
      const moov = Moov(moovAccessToken);
      moov.plaid.initialize( ... );
    });
  </script>
</body>

Initialize a connection to Plaid, allowing users to instantly verify and link bank accounts to an existing Moov account. Note: For Moov-managed Plaid integrations only.

Parameters

Name Type Description
accountID UUID string ID for an existing Moov user account
env "sandbox" or undefined Plaid environment. Use "sandbox" for testing. Use undefined for production.
elementID string Optional. If provided, Plaid flow will open when the DOM element with this ID is clicked.
redirectURL URL string If Plaid forces the user to a bank’s website, they will eventually return to this URL. Must be a webpage on your current domain. Contact Moov support and select submit a support ticket for technical issues, including the redirectURL so Moov can register this URL in the Plaid dashboard. If you ever change your redirectURL, contact Moov support again and include the new URL.
onSuccess (moovBankAccount) => void Optional. Callback function executed when Plaid successfully links a bank account to Moov. Moov bank account object is passed as a parameter.
onExit (err, metadata) => void Optional. Callback function executed when the user exits the Plaid flow.
onEvent (eventName, metadata) => void Optional. Callback function executed on each Plaid event.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
moov.plaid.initialize({
  accountID: "your-connected-account-id",
  env: "sandbox",
  elementID: "your-plaid-button-id",
  redirectURL: "https://yoursite.com/plaidredirecturl",
  onSuccess: (bankAccount) => {
    console.log("Success! Moov bank account: ", bankAccount);
  },
  onExit: (err, metadata) => {
    console.log("Plaid flow exited: ", err);
  },
  onEvent: (eventName, metadata) => {
    console.log("Plaid event emitted: ", eventName);
  }
});
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
moov.plaid.initialize({
  accountID: "your-connected-account-id",
  env: "sandbox",
  redirectURL: "https://yoursite.com/plaidredirecturl",
  onSuccess: (bankAccount) => {
    console.log("Success! Moov bank account: ", bankAccount);
  },
  onExit: (err, metadata) => {
    console.log("Plaid flow exited: ", err);
  },
  onEvent: (eventName, metadata) => {
    console.log("Plaid event emitted: ", eventName);
  }
}).then((plaidHandler) => {
  plaidHandler.open();
});

Reinitialize Plaid (Oauth redirects)

Some banks use an OAuth flow to connect to Plaid. In these situations, your user will be redirected to the bank’s website to authenticate, and then redirected back to your specified redirectURL. This redirect landing page must run moov.plaid.reinitialize to resume the Plaid flow.

Parameters

Name Type Description
receivedRedirectUri URL string Brings the user back to the page they were on before Plaid redirected to a bank’s website. From there, Moov will detect that the Plaid process has completed and will resume linking the bank account. This parameter will be a combination of your redirectURL and query parameters set by Plaid.
accountID UUID string ID for an existing Moov user account
env "sandbox" or undefined Plaid environment. Use "sandbox" for testing. Use undefined for production.
elementID string Optional. If provided, Plaid flow will open when the DOM element with this ID is clicked.
onSuccess (moovBankAccount) => void Optional. Callback function executed when Plaid successfully links a bank account to Moov. Moov bank account object is passed as a parameter.
onExit (err, metadata) => void Optional. Callback function executed when the user exits the Plaid flow.
onEvent (eventName, metadata) => void Optional. Callback function executed on each Plaid event.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
moov.plaid.reinitialize({
  accountID: "your-connected-account-id",
  receivedRedirectUri: window.location.href,
  env: "sandbox",
  onSuccess: (bankAccount) => {
    console.log("Success! Moov bank account: ", bankAccount);
  },
  onExit: (err, metadata) => {
    console.log("Plaid flow exited: ", err);
  },
  onEvent: (eventName, metadata) => {
    console.log("Plaid event emitted: ", eventName);
  }
});

Using Plaid sandbox

You can use the env: "sandbox" setting in your Plaid configuration object to simulate the process for connecting a bank account with Plaid.

In Plaid’s sandbox environment, you can find test bank accounts by searching for Platypus. For all Platypus bank accounts, the username is user_good and the password is pass_good.

Note that the Platypus account cannot be used for testing transfers. The purpose of the test account is solely for simulating connecting bank accounts.

Duplicate accounts: There’s an ongoing issue with Plaid’s sandbox environment, where OAuth Platypus banks may throw a duplicate account error at the end of the Plaid Link flow. Unfortunately, this issue is outside of Moov’s control. This issue is limited to Plaid’s sandbox environment, and should not affect users in production.
Summary Beta