Building with MoneyKit
Building with MoneyKit
API Keys and Environments
There are two different MoneyKit API environments that both live within a single URL, and each environment will have its own pair of API keys for authenticating your requests.
MoneyKit API URL
Environments
Front End SDKs
MoneyKit’s front end SDK for linking bank accounts is called Connect.
Connect SDK is currently available for:
The Connect SDK will take in your various configurations for the bank linking experience like your theme and product requirements, and will keep you informed of the end user’s linking experience through event callbacks.
A successful linking experience will return you a temporary exchangeable_token
in the success callback, that you will then exchange with the MoneyKit API for a long-lived link_id
.
Creating your first MoneyKit Link
A Link is what is created when one of your end users successfully links their bank accounts with your MoneyKit integration.
Every Link has a link_id
, and this is what you will use to identify those accounts when fetching product data from
the MoneyKit API.
From a developer perspective, it only takes 5 steps to create a link and then fetch data for it.
- Create a Bearer token to authenticate your requests to
api.moneykit.com
- Create a
link_session_token
with your custom configurations for the linking session - Pass the
link_session_token
to the Connect SDK in your front end application to launch the linking experience - Pass the temporary
exchangeable_token
received from the SDK’s success callback to the MoneyKit API to receive alink_id
for the new Link. - Use the
link_id
with your requests to the MoneyKit product endpoints to fetch data for the link
Below is a walkthrough of these five steps including code examples.
Open Connect Directly to an Institution’s Login Screen
In some cases you might want to bypass the Connect institution search screen, and launch the Connect SDK directly to a specific institution’s login screen.
To do this you want to include the institution_id
in your request to https://api.moneykit.com/link-session
.
Re-authenticate a broken Link
If you receive an auth_expired
error with one of your Links, this means the Link needs to be re-authenticated by the owner of those accounts. In order to launch the Connect SDK directly to that institution for a re-authentication flow, just include the respective link_id
in your request to https://api.moneykit.com/link-session
.
When re-authenticating a Link, there will be no exchangable_token
returned by the Connect SDK success callback, and
thus no need to call the MoneyKit exchange endpoint. Once the user successfully authenticates their accounts, you will
be able to resume using the existing link_id
.
Handle OAuth redirect
In order to successfully complete an OAuth linking experience, you will need to pass a redirect_uri with your request to https://api.moneykit.com/link-session
. Whatever URI you include is where MoneyKit will return the end user after they successfully complete an OAuth Link.
It is imperative that the page in your application that is redirected to has implemented the continue()
method for
the Connect SDK. This ensures that the OAuth flow is completed.
iOS Example
Scene Delegate code to handle incoming redirect:
ViewController using the Connect SDK to continue the OAuth flow: