X Enterprises
fastify-xplaid

accounts.get(accessToken, options?)

Get all accounts associated with a Plaid Item.

accounts.get(accessToken, options?)

Returns all accounts associated with an Item, including account name, type, subtype, mask, and current balance snapshot.

Signature

fastify.xplaid.accounts.get(
  accessToken: string,
  options?: { accountIds?: string[] }
): Promise<{ accounts: Account[]; item: Item; requestId: string }>

Params

NameTypeRequiredDescription
accessTokenstringYesThe Item's access token
options.accountIdsstring[]NoFilter to specific account IDs

Returns

{ accounts: Account[]; item: Item; requestId: string }

Throws

  • Error: [xPlaid] accessToken is required and must be a non-empty string
  • Plaid API error with .plaidError and .statusCode

Examples

List all accounts

fastify.get("/accounts", async (request) => {
  const item = await getPlaidItem(request.user.id);
  const { accounts } = await fastify.xplaid.accounts.get(item.accessToken);

  return accounts.map((a) => ({
    id: a.account_id,
    name: a.name,
    type: a.type,
    subtype: a.subtype,
    mask: a.mask,
  }));
});

Filter to checking accounts only

const { accounts } = await fastify.xplaid.accounts.get(accessToken);
const checkingIds = accounts
  .filter((a) => a.subtype === "checking")
  .map((a) => a.account_id);

const { accounts: checking } = await fastify.xplaid.accounts.get(accessToken, {
  accountIds: checkingIds,
});

See also

AI Context

package: "@xenterprises/fastify-xplaid"
method: fastify.xplaid.accounts.get(accessToken, options?)
use-when: Get all accounts for a Plaid Item with last-known balance snapshot (cached, not live)
returns: { accounts: [ { account_id, name, type, subtype, balances, mask } ] }
Copyright © 2026