Skip to main content
Use these operations to let a user connect a bank account to Fluz through Plaid Link. Linking is the entry point for all bank-account funding: once an account is connected, you can read its balance and spend power, pull its transaction history, and repair the connection if it later drops — each covered on its own page. Transactional Graph Service (TGS) exposes a public GraphQL wrapper over the Fluz Plaid integration. Identity-service remains the system of record for Plaid tokens, bank-account ingestion, balances, historical transactions, and Plaid webhooks. TGS never returns Plaid access tokens or public tokens to your app.

Auth

Call /api/v1/graphql with a Fluz user Bearer access token that includes the MANAGE_PAYMENT scope. The Plaid fields do not allow Basic auth. Obtain a user access token through the standard TGS auth flow first, then call these fields with:
  1. Create a Link token (createPlaidLinkToken).
  2. Open Plaid Link with that token.
  3. On Plaid’s onSuccess, send the returned public_token back to TGS (completePlaidLink).
  4. Store the platformItemId from the completion response — it’s the safe public identifier you’ll use later to relink.
For native Link, pass deviceOs as IOS or ANDROID so identity-service includes the correct Plaid OAuth redirect option.
Initialize Plaid Link with the returned linkToken. (See the Web SDK example below.) In Plaid Link’s onSuccess, send the returned public_token to TGS.

4. Store the platformItemId

Save platformItemId from the completion response. This is the safe public identifier used later to relink a disconnected connection. If it isn’t returned, call getPlaidBankAccounts for the user and store the persisted platformItemId from that response. If completePlaidLink returns requiresAddress: true, attach an address before the account is usable — see Attach an address below.

Plaid Web SDK example

Plaid’s Web SDK script must be loaded directly from Plaid’s CDN.
Create a Link token through TGS, initialize Plaid Link with that token, and pass Plaid’s public_token back to TGS in onSuccess. Calling startPlaidLink() with no argument begins a new link; calling startPlaidLink(existingPlatformItemId) begins a relink (see Relinking Disconnected Bank Accounts).

List linked accounts

Return the safe Plaid bank accounts for the authenticated user.

Attach an address

If completePlaidLink returned requiresAddress: true, attach an address to the linked bank institution.

Remove a bank connection

Remove a Plaid bank institution from the user’s account.

Security boundaries

TGS never returns Plaid access tokens, Plaid public tokens, identity-match details, bank account numbers, or routing numbers. Bank account names and nicknames may be user-entered banking labels and are returned only as account metadata. Identity-service remains responsible for:
  • Plaid token exchange
  • Plaid access token storage
  • Bank institution and bank account creation or repair
  • Balance fetching
  • Historical transaction ingestion
  • Bank institution removal
  • Plaid webhooks
TGS does not expose identity-service directly and does not add a public Plaid webhook route.

Unsupported flows

Manual Plaid micro-deposit linking is intentionally unsupported by this public wrapper. New links and relinks must use the normal Plaid Link flow, which supports balances and historical transactions. If a user starts a new link for the same institution instead of choosing relink, complete it as a normal new link. Identity-service owns bank-account dedupe and repair; store the returned platformItemId after completion.

Error handling

If completePlaidLink times out or fails after Plaid returned a public_token, first call getPlaidBankAccounts using the stored or expected platformItemId before retrying. Retry only if Plaid returns a fresh public_token from a new Link session — Plaid public tokens are short-lived and single-use.