Introduction to Transactions
Retrieve up to 24 months of transaction data and stay up-to-date with webhooks.
API Reference
View Transactions requests, responses, and example code
View Transactions APIQuickstart
Learn about Plaid's key concepts and run starter code
Get startedOverview
Transactions data can be useful for many different applications, including
personal finance management, expense reporting, cash flow modeling, risk
analysis, and more. Plaid's Transactions product allows you to access a user's
transaction history for depository
type accounts such as checking and savings
accounts, credit
type accounts such as credit cards, and student loan
accounts. For transaction history from investment accounts, use Plaid's
Investments product.
Transactions data available via /transactions/sync
includes transaction date, amount, category, merchant,
location, and more. Transaction data is lightly cleaned to populate the name
field, and more thoroughly processed to populate the merchant_name
field. For example data, see the Transactions API reference.
Integration overview
The steps below show an overview of how to integrate Transactions. For a detailed, step-by-step view, you can also watch our full-length, comprehensive tutorial walkthrough.
Call
/link/token/create
. Along with any other parameters you specify, make sure to include the following:- The
products
array should includetransactions
. - Specify a
webhook
to receive transactions updates. - Specify a value for
transactions.days_requested
corresponding to the amount of transaction history your integration needs. The more transaction history is requested, the longer the historical update poll will take. The default value is 90; the maximum value is 730.
- The
On the client side, create an instance of Link using the
link_token
returned by/link/token/create
; for more details, see the Link documentation.Once the end user has completed the Link flow, exchange the
public_token
for anaccess_token
by calling/item/public_token/exchange
.Create a method to call
/transactions/sync
. This method must do the following:- The first time
/transactions/sync
is called on an Item, call/transactions/sync
with no cursor value specified - Save the
next_cursor
value returned by/transactions/sync
to use as an input parameter in the next call to/transactions/sync
- If
has_more
in the/transactions/sync
response istrue
, handle paginated results by temporarily preserving the current cursor, then calling/transactions/sync
with the newly returned cursor. After each/transactions/sync
call, call/transactions/sync
with the newly returned cursor from the previous/transactions/sync
call untilhas_more
isfalse
. - When handling paginated results, if
TRANSACTIONS_SYNC_MUTATION_DURING_PAGINATION
error is returned during pagination, restart the process in the previous bullet with the old cursor that was temporarily preserved. Oncehas_more
isfalse
, it is safe to stop preserving the old cursor.
For an example, see fetchNewSyncData and syncTransactions.
- The first time
Call the
/transactions/sync
wrapper you created in the previous step, passing in theaccess_token
, in order to activate the Item for theSYNC_UPDATES_AVAILABLE
webhook. It is common that no transactions will be returned during this first call, as it takes Plaid some time to fetch initial transactions.(Optional) Wait for the
SYNC_UPDATES_AVAILABLE
webhook to fire with theinitial_update_complete
field set totrue
and thehistorical_update_complete
set tofalse
. When this occurs, you may optionally call your/transactions/sync
wrapper to obtain the most recent 30 days of data. If your end-user is expecting to see data load into your app in real-time, this can help improve the responsiveness of your app.Wait for the
SYNC_UPDATES_AVAILABLE
webhook to fire with thehistorical_update_complete
field set totrue
. Once it does, call your/transactions/sync
wrapper to obtain all available updates.From this point forward, Plaid will periodically check for transactions data for your Item. When it detects that new transactions data is available, the
SYNC_UPDATES_AVAILABLE
webhook will fire again. When it does, call your/transactions/sync
wrapper to receive all updates since thenext_cursor
value. In addition to added transactions, these subsequent updates may also includeremoved
ormodified
transactions. For details, see Transactions updates.(Optional) If you would like to check for updates more frequently than Plaid's default schedule, call
/transactions/refresh
to force an on-demand update. If any new transaction data is available, aSYNC_UPDATES_AVAILABLE
webhook will fire.
Transactions updates
Transactions data is not static. As time passes, your users will make new transactions, and transactions they made in the past will change as they are processed by the financial institution. To learn more about how transactions are processed and can change, see Transaction states.
Plaid checks for updated transactions regularly, and uses webhooks to notify you of any changes so you can keep your app up to date. For more detail on how to listen and respond to transaction update webhooks, see Transaction webhooks.
The frequency of transactions update checks is typically one or more times a day. The exact frequency will depend on the institution. To
learn when an Item was last checked for updates, you can view the Item in the
Item Debugger. If you would
like to display this information in your app's UI to help users understand the
freshness of their data, it can also be retrieved via API, using the /item/get
endpoint.
You can also request an update on-demand via the /transactions/refresh
endpoint, which is available as an add-on for Transactions customers. To request
access to this endpoint, submit a
product access request or contact
your Plaid account manager.
Recurring transactions
If your app involves personal financial management functionality, you may want
to view a summary of a user's inflows and outflows. The
/transactions/recurring/get
endpoint provides a summary of the recurring
outflow and inflow streams and includes insights about each recurring stream
including the category, merchant, last amount, and more.
/transactions/recurring/get
is available as an add-on for Transactions
customers in the US, Canada, and UK. To request access to this endpoint, submit
a product access request or contact
your Plaid account manager.
Sample app demo and code
The Transactions sample app is a simple app designed to accompany the Transactions YouTube tutorial.
Try out the Pattern Demo for a demonstration of a sample app that uses Plaid's Transactions product for the personal financial management use case to calculate and display a customer's net worth and spending habits and allows them to link multiple financial institutions.
For a more robust example of an app that incorporates transactions, along with sample code for transactions reconciliation, see the Node-based Plaid Pattern sample app.
Updating your app
If you've already built an app using Plaid's /transactions/get
endpoint, see
the Transactions Sync migration guide to
learn about Plaid's latest Transactions endpoint and how to simplify your integration
by migrating to /transactions/sync
.
Testing Transactions in Sandbox
For Sandbox transactions testing, it is recommended to use the special user_transactions_dynamic
user (password: any non-blank password), instead of the standard user_good
test user. You can create a public token for this user using /sandbox/public_token/create
; if using the interactive Link flow, you must use a non-OAuth test institution such as First Platypus Bank (ins_109508
). Unlike user_good
, user_transactions_dynamic
contains realistic, dynamic transactions data and can be used together with the /transactions/refresh
endpoint to simulate Transactions updates and trigger webhooks in Sandbox. For more details on how to simulate transaction activity with this user, see Testing pending and posted transactions.
Transactions pricing
Transactions and the optional Recurring Transactions add-on are billed on a subscription model. The optional Transactions Refresh add-on is billed on a per-request model. To view the exact pricing you may be eligible for, apply for Production access or contact Sales. For more details about pricing and billing models, see Plaid billing.
Next steps
To get started building with Transactions, see Add Transactions to your App.
If you're ready to launch to Production, see the Launch Center.