Plaid Integration

Lynx utilizes Plaid for external bank account integration. We provide a client-side component that your users will interact with in order to link their accounts to Plaid and allow you to access their accounts via the Plaid API.

You can interact through the abstract interface that Lynx has established with Plaid to allow your members to easily validate their external third party bank account. Once connected Lynx maintains the Plaid token which is used to securely facilitate member contributions.

Plaid Integration Flow Overview

  1. Register a redirect URL with Lynx - in order to do this, please contact a member of our Customer Success team.

  2. Call Get Link Token to create a link token to be used for the Plaid component.
    2a. One of the parameters to this API is the same redirect URL from step #1.

  3. Within your UI, use LynxPlaid.js to open a UI modal dialog by calling Lynx.init (See Installation below).

  4. User is redirected to their bank institution's website and enters their credentials and selects the account they wish to link.

  5. User is redirected back to your website with an access token (partnerAccessToken) and account details (partnerAccountId)
    5a. The actual passing of the partnerAccessToken and the partnerAccountId parameters happens in the callback that was specified within Lynx.init.

  6. Call Link External Account Verified and pass the partnerAccountId and partnerAccessToken as well as other mandatory fields to link the account.

Installation

Include the LynxPlaid initialize script on the page of your site:

<script src="https://cdn.lynx-fh.com/LynxPlaid.js"></script>

Note: The page URL which you initialize the script from must be registered with Lynx in order for the flow to work.

Lynx.init accepts one argument, a configuration Object:

{
  clientMemberId: '12345678',
  token: 'link-sandbox-20236f21-6e8d-4565-97c7-c7a8db351005',
  callback: (public_token, metadata) => {
    const account = {
      data: {
        memberBankAccount: {
          partnerAccessToken: public_token,
          partnerAccountId: metadata.account_id,
          name: metadata.institution.name + " - " + metadata.account.name,
          type: metadata.account.subtype
        }
      }
    };
    console.log(account);
  }
}

clientMemberId
Client Member Id of the member who wishes to link their account

token
Link token used to initialize the Plaid window pane (from step #2 above)

callback
Handler function to be executed when a user successfully links an account. It receives two arguments: a publictoken (**_partnerAccessToken**) and metadata object (**partnerAccountId** and other details)

Ideally the callback function can be used to build the body params to be passed to the Link External Account Verified endpoint.

Source Code

window.Lynx={init:function(e){let t=Plaid.create({token:e.token,onSuccess:e.onSuccess,onExit:e.onExit,received_redirect_uri:window.location.href});t.open()},open:function(){let e=JSON.parse(localStorage.getItem("lynxData"));(handler=Plaid.create({token:e.token,onSuccess(){},onLoad(){},onExit(e,t){},onEvent(e,t){},receivedRedirectUri:window.location.href})).open()}},(script=document.createElement("script")).src="https://cdn.plaid.com/link/v2/stable/link-initialize.js",script.type="text/javascript",script.defer=!0,document.getElementsByTagName("head").item(0).appendChild(script),window.onload=function(){let e=new URLSearchParams(window.location.search),t=Object.fromEntries(e.entries());void 0!==t.oauth_state_id&&Lynx.open()};