plaid

Get incremental transaction updates on an Item

The /transactions/sync endpoint allows developers to subscribe to all transactions associated with an Item and get updates synchronously in a stream-like manner, using a cursor to track which updates have already been seen.

/transactions/sync provides the same functionality as /transactions/get and can be used instead of /transactions/get to simplify the process of tracking transactions updates. To learn more about migrating from /transactions/get, see the Transactions Sync migration guide.

This endpoint provides user-authorized transaction data for credit, depository, and some loan-type accounts (only those with account subtype student; coverage may be limited). For transaction history from investments accounts, use /investments/transactions/get instead.

Returned transactions data is grouped into three types of update, indicating whether the transaction was added, removed, or modified since the last call to the API.

In the first call to /transactions/sync for an Item, the endpoint will return all historical transactions data associated with that Item up until the time of the API call (as "adds"), which then generates a next_cursor for that Item. In subsequent calls, send the next_cursor to receive only the changes that have occurred since the previous call.

Due to the potentially large number of transactions associated with an Item, results are paginated. The has_more field specifies if additional calls are necessary to fetch all available transaction updates. Call /transactions/sync with the new cursor, pulling all updates, until has_more is false.

When retrieving paginated updates, track both the next_cursor from the latest response and the original cursor from the first call in which has_more was true; if a call to /transactions/sync fails due to the TRANSACTIONS_SYNC_MUTATION_DURING_PAGINATION error, the entire pagination request loop must be restarted beginning with the cursor for the first page of the update, rather than retrying only the single request that failed.

Whenever new or updated transaction data becomes available, /transactions/sync will provide these updates. Plaid typically checks for new data multiple times a day, but these checks may occur less frequently, such as once a day, depending on the institution. An Item's status.transactions.last_successful_update field will show the timestamp of the most recent successful update. To force Plaid to check for new transactions, use the /transactions/refresh endpoint.

For newly created Items, data may not be immediately available to /transactions/sync. Plaid begins preparing transactions data when the Item is created, but the process can take anywhere from a few seconds to several minutes to complete, depending on the number of transactions available.

To be alerted when new data is available, listen for the SYNC_UPDATES_AVAILABLE webhook.

/transactions/sync does not directly return balance data. To get the balance for an account, call /accounts/get, which is a free-to-use endpoint that will return the cached balance as of the last successful transactions update.

post/transactions/sync

Request body

client_idstring

Your Plaid API client_id. The client_id is required and may be provided either in the PLAID-CLIENT-ID header or as part of a request body.

access_tokenstring required

The access token associated with the Item data is being requested for.

secretstring

Your Plaid API secret. The secret is required and may be provided either in the PLAID-SECRET header or as part of a request body.

cursorstring

The cursor value represents the last update requested. Providing it will cause the response to only return changes after this update. If omitted, the entire history of updates will be returned, starting with the first-added transactions on the Item. The cursor also accepts the special value of "now", which can be used to fast-forward the cursor as part of migrating an existing Item from /transactions/get to /transactions/sync. For more information, see the Transactions sync migration guide. Note that using the "now" value is not supported for any use case other than migrating existing Items from /transactions/get.

The upper-bound length of this cursor is 256 characters of base64.

countinteger

The number of transaction updates to fetch.

Response

OK

next_cursorstring required

Cursor used for fetching any future updates after the latest update provided in this response. The cursor obtained after all pages have been pulled (indicated by has_more being false) will be valid for at least 1 year. This cursor should be persisted for later calls. If transactions are not yet available, this will be an empty string.

has_moreboolean required

Represents if more than requested count of transaction updates exist. If true, the additional updates can be fetched by making an additional request with cursor set to next_cursor. If has_more is true, it’s important to pull all available pages, to make it less likely for underlying data changes to conflict with pagination.

request_idstring required

A unique identifier for the request, which can be used for troubleshooting. This identifier, like all Plaid identifiers, is case sensitive.

Changes