fastify-xplaid
transactions.getRecurring(accessToken, options?)
Get recurring inflow and outflow transaction streams for a Plaid Item.
transactions.getRecurring(accessToken, options?)
Retrieves recurring transaction streams identified by Plaid — subscriptions, payroll deposits, loan payments, utility bills, etc.
Signature
fastify.xplaid.transactions.getRecurring(
accessToken: string,
options?: { accountIds?: string[] }
): Promise<{
inflowStreams: RecurringStream[]
outflowStreams: RecurringStream[]
updatedDatetime: string
requestId: string
}>
Params
| Name | Type | Required | Description |
|---|---|---|---|
accessToken | string | Yes | The Item's access token |
options.accountIds | string[] | No | Filter to specific account IDs |
Returns
| Field | Description |
|---|---|
inflowStreams | Regular income (payroll, rent income, etc.) |
outflowStreams | Regular bills and subscriptions |
updatedDatetime | When Plaid last updated the streams |
Throws
Error: [xPlaid] accessToken is required and must be a non-empty string- Plaid API error with
.plaidErrorand.statusCode
Examples
Show subscriptions dashboard
fastify.get("/subscriptions", async (request) => {
const item = await getPlaidItem(request.user.id);
const { outflowStreams } = await fastify.xplaid.transactions.getRecurring(item.accessToken);
const subscriptions = outflowStreams.filter(
(s) => s.frequency !== "UNKNOWN" && s.status === "MATURE"
);
return subscriptions.map((s) => ({
name: s.merchant_name || s.description,
amount: s.average_amount.amount,
frequency: s.frequency,
lastDate: s.last_date,
}));
});
Calculate monthly recurring expenses
const { outflowStreams } = await fastify.xplaid.transactions.getRecurring(accessToken);
const monthlyTotal = outflowStreams
.filter((s) => s.status === "MATURE")
.reduce((sum, s) => sum + Math.abs(s.average_amount.amount), 0);
See also
- transactions.sync(accessToken, options?) — all transaction data
AI Context
package: "@xenterprises/fastify-xplaid"
method: fastify.xplaid.transactions.getRecurring(accessToken, options?)
use-when: Get recurring transaction streams (subscriptions, bills, income) detected by Plaid
params: accessToken, accountIds (optional filter)
returns: { inflowStreams, outflowStreams, updatedDatetime, requestId }
