Plaid Bank Linking
We use Plaid to enable users to link their bank accounts to Ratio, which they can use to purchase crypto from fiat in their bank.
There are several steps involved in linking a bank account with Plaid, the first of which requires you to request a Link Token on behalf of the user.
post
https://api.staging.ratio.me
/v1/users/{userId}/banks:requestLink
Requests a bank account link token for a user
You now have a link token that looks something like this:
link-sandbox-ab12c3d4-0000-123a-987f-26e621c2ee51
. This token needs to be provided to Plaid through one of several methods:Using Plaid's React Native SDK provides a component that will take your link token and returns a public token on success.
Similar to the React Native SDK, these provide UI components for launching the Plaid Link flow. https://plaid.com/docs/link/ios/ - https://plaid.com/docs/link/android/
You can also launch the Plaid Link flow inside a webview, requiring minimal UI work. To do so, create a URL like so
https://cdn.plaid.com/link/v2/stable/link.html?isWebview=true&token="GENERATED_LINK_TOKEN"
and open it inside a webview. This will also emit events for you to consume to obtain the public token.Now that you have a public token, you can proceed with the next step, which is activating the link between Ratio and Plaid.
post
https://api.staging.ratio.me
/v1/users/{userId}/banks:activateLink
Activates a bank account link for a user
If you receive a successful response, the bank account has been linked, and you may proceed to make purchases.
Plaid Links can expire or disconnect from time to time, possibly at the request of the user or the financial institution. If a user wishes to perform a transaction, but the bank link has been disconnected, you will receive a response indicating such. To repair this, request an update token and go through the Plaid flow again.
post
https://api.staging.ratio.me
/v1/users/{userId}/banks/{bankId}:requestLink
Requests an update link token to re-login to an existing bank account
Last modified 2mo ago