Closed sleep9 closed 5 months ago
There is not a way to keep the initial transaction pull from being broken into two parts (historical and initial). If you don't want to wait for the webhook, I suppose you could just wait for a few minutes before calling the sync endpoint to have really good odds that the fetch is complete, or alternatively you could poll /transactions/sync
on the item, watch the transactions_update_status
field, wait for it to update toHISTORICAL_UPDATE_COMPLETE
, and then re-call /transactions/sync
on that item with a null
cursor to get all the transactions from the beginning. However, we strongly encourage you to implement webhooks, since they are pretty core to how Plaid handles async behaviors, and the Plaid API has a lot of async behaviors, especially when using the transactions endpoints.
Thanks for your reply... I cant seem to find in the documentation how/where to declare the webhook url programmatically for transactions. It seems as though I need to proceed with webhook approach.
Its unfortunate that historical data is not readily available. Even with a debounce + poll it still returns initial.
The webhook url is set when calling /link/token/create: https://plaid.com/docs/api/tokens/#link-token-create-request-webhook
If you are not getting historical data ever, I suggest you:
1) Make sure you are setting days_requested
correctly https://plaid.com/docs/api/tokens/#link-token-create-request-transactions-days-requested
2) Try waiting ~10 minutes before calling the sync endpoint for the first time (if this fixes the issue there's probably a problem in your code regarding how you're handling cursors...see my note about polling the sync endpoint to watch for updates to the transactions_update_status
field and then calling with a null
cursor after it updates)
3) Try linking a different account to rule out issues with your specific bank
Closing this out as it's not related to the node client library -- if you continue to have trouble, feel free to file a support ticket
From the documentation
However when I call transactions sync for the first time (with next_cursor not present) after linking the accounts I receive INITIAL_UPDATE_COMPLETE and only 30 days of transactions.
Is there a way to force the endpoint to return historical transactions when first linking to the account? I would like to avoid using webhooks if neccessary.