Transaction updates webhooks are sent when there is a change in the transactions for the financial connection. This typically occurs at least once a day.
{
type: 'transactions.updates',
financial_connection_id: "financial_connection_id",
environment: "sandbox",
source: "teller",
//Boolean indicating whether historical transaction information (up to 24 months) is ready to be queried.
historical_transactions_available: true,
//An array of string transaction ids indicated the transactions that have been removed and will not be available if the transactions are queried again. Currently only supported by plaid
removed_transaction_ids: [
"tx_1234",
"tx_5677"
]
remote_data: {}
}
Example usage
//Make a fetch of the last two years if it's available and it has not already been fetched
if (webhook.historical_transactions_available && this.historyNotFetched()) {
await this.retrieveAndStoreTransactionsFromLastTwoYears({
connectionItemId: conn.itemId,
webhook
});
} else if (webhook.removed_transaction_ids && webhook.removed_transaction_ids.length > 0) {
await this.deleteRemovedTransactions(webhook.removed_transaction_ids)
}) else {
//Sync new and updated transactions from the get transactions endpoint with our database
await this.retrieveAndUpdateTransactionsFromLastDay(webhook)
}