Server Side Changes - 5 lines of code
Examples below are using node and python but can be applied to any plaid codebase.
Change the plaid base path to one of these URLs and add your fuse-client-id and fuse-api-key-headers
https://sandbox-api.letsfuse.com/v1/plaid
https://api.letsfuse.com/v1/plaid
export const getPlaidClient = (): PlaidApi => {
const configuration = new Configuration({
basePath: `${FUSE_BASE_URL}/v1/plaid`,
baseOptions: {
headers: {
"Plaid-Client-Id": plaidClientId,
"Plaid-Secret": plaidSecret,
"Plaid-Version": plaidVersion,
"Fuse-Client-Id": fuseClientId,
"Fuse-Api-Key": fuseSecret,
},
},
});
return new PlaidApi(configuration);
};
configuration = plaid.Configuration(
host="{}/v1/plaid".format(base_url),
api_key={
'clientId': plaid_client_id,
'secret': plaid_secret,
}
)
plaid_api_client = plaid.ApiClient(configuration)
plaid_api_instance = plaid_api.PlaidApi(plaid_api_client)
plaid_api_client.default_headers["Fuse-Client-Id"] = fuse_client_id
plaid_api_client.default_headers["Fuse-Api-Key"] = fuse_secret
Update your plaid link/token/create request to include a session client secret and institution id.
const linkTokenCreateRequest: LinkTokenCreateRequest = {
// When no client secret and institution id is passed in, a plaid (not fuse) link token is returned
// This allows deploying the backend changes first before the frontend changes
...(sessionClientSecret && {
session_client_secret: sessionClientSecret,
}),
...(institutionId && {
institution_id: institutionId,
}),
client_name: "my-client-name",
user: {
client_user_id: "my-entity-id",
},
language: "en",
country_codes: [CountryCode.Us],
products: [Products.Auth, Products.Identity, Products.Transactions],
account_filters: {
depository: {
account_subtypes: [DepositoryAccountSubtype.All],
},
},
};
const linkToken = await getPlaidClient().linkTokenCreate(
linkTokenCreateRequest
);
create_link_token_response = plaid_api_instance.link_token_create(link_token_create_request=LinkTokenCreateRequest(
session_client_secret=client_secret,
institution_id=institution_id,
language="en",
user=LinkTokenCreateRequestUser(client_user_id="my-entity-id"),
country_codes=plaid_countries,
products=plaid_products,
client_name="my-client-name"
))
Below is a table of all the plaid endpoints supported as well as important information above each one.
For all other Plaid endpoints not specified in the table, Fuse will act as a Plaid proxy, forwarding the exact request and returning the exact response from the upstream Plaid request.
You can retrieve the plaid access token and item id from the financial connection id using the /financial_connections/{financial_connection_id} endpoint
Endpoint | Placeholder Fields - Do not use these fields | Notes |
---|---|---|
link/token/create | ||
item/public_token/exchange | ||
accounts/get | - All item fields except item_id and institution_id | |
auth/get | - accounts - item | |
accounts/balance/get | - Any field in accounts except balances - item | Wrap in a retry mechanism as the endpoint has a 30 second timeout which may be exceeded. |
identity/get | - Any field in accounts except owners - item | |
transactions/get | - accounts - item | Wrap in a retry mechanism as the endpoint has a 30 second timeout which may be exceeded. Replace the "offset" field with "page". Page works differently in that to get the next set of results you increment the page by 1 as opposed to offset where you set it to the number of results you want to skip. The max value for the "count" field is 100, as opposed to 500. |
investments/holdings/get | - item | |
investments/transactions/get | - item | |
institutions/get_by_id | - products - routing_numbers - oauth | |
item/remove |
Updated about 1 year ago