Financial Connection Data Syncing

Learn how to be notified of updates to users using our unified webhook model.

Syncing

Fuse unifies and manages the data for a new financial connection. When it is time to sync this data, Fuse will send a financial_connection.sync_data webhook.

When you get the financial_connection.sync_data webhook, make sure to hit the sync endpoint to update the financial connection data. Don't forget to forward the body of the request as the body and the API keys of your aggregators in the request headers when making the call, as well as the fuse-verification header.

curl --location --request POST 'https://yz9sph5c42.execute-api.us-east-1.amazonaws.com/v1/financial_connections/sync' \
--header 'fuse-api-key: my-fuse-api-key' \
--header 'fuse-client-id: my-fuse-client-id' \
--header 'plaid-client-id: my-plaid-client-id' \
--header 'plaid-secret: my-plaid-secret' \
--header 'teller-application-id: my-teller-application-id' \
--header 'teller-certificate: my-teller-certificate' \
--header 'teller-signing-secret: my-teller-signing-secret' \
--header 'teller-private-key: my-teller-private-key' \
--header 'mx-api-key: my-mx-api-key' \
--header 'mx-client-id: my-mx-client-id' \
--header 'fuse-verification: fuse-verification-header-value' \
--header 'Content-Type: application/json' \
--data-raw webhook_data
import {FuseApi, Configuration} from "fuse-node";

const configuration = new Configuration({
    basePath: config.FUSE_BASE_PATH,
    baseOptions: {
        headers: {
            'Fuse-Client-Id': 'my-fuse-client-id',
            'Fuse-Api-Key': 'my-fuse-api-key',
            'Content-Type': 'application/json',
            'Plaid-Client-Id': 'my-plaid-client-id',
            'Plaid-Secret': 'my-plaid-secret-id',
            'Teller-Application-Id': 'my-teller-application-id',
            'Teller-Certificate': 'my-teller-certificate',
            'Teller-Private-Key': 'my-teller-private-key',
            'Teller-Signing-Secret': 'my-teller-signing-secret',
            'Mx-Client-Id': 'my-mx-client-id',
            'Mx-Api-Key': 'my-mx-api-key',
        },
    },
});

const fuseApi = new FuseApi(configuration);

app.post("/webhook", async (req: any, res: any) => {
   const isFuseWebhook = requestIsFromFuse(req.body, req.headers);
   if (!isFuseWebhook) {
     res.status(403).json({
       message: "Invalid webhook"
     });
     return;
  }
  
  if (req.body["type"] === "financial_connection.sync_data") {
    const fuseVerificationHeader = req.headers[
    	'fuse-verification'
		] as string;
		const response = await fuseApi.syncFinancialConnectionsData(req.body, {
    	headers: {
        'fuse-verification': fuseVerificationHeader
    	}
		});
  }
});