---
name: flinks
description: Use when integrating financial data aggregation, payment
  processing, or data enrichment. Reach for this skill when building account
  linking flows, retrieving banking data, processing payments via EFT or
  e-Transfer, enriching transaction data with attributes, or uploading and
  processing financial documents.
metadata:
  mintlify-proj: flinks
  version: "1.0"
---

# Flinks Skill

## Product summary

Flinks is a financial data aggregation and payment processing platform backed by the National Bank of Canada. It securely connects end-user banking accounts, retrieves financial data, processes payments, and enriches transaction data with actionable insights. Agents use Flinks to build account linking flows (via Flinks Connect or Express), retrieve account details and transactions, set up payment processing (EFT or e-Transfer), enrich data with attributes, and upload/process financial documents.

**Key files and endpoints:**
- Base URLs: `https://{instance}-api.private.fin.ag/v3/{customerId}/` (API) and `https://{instance}-iframe.private.fin.ag/` (Connect iframe)
- Core endpoints: `/Authorize`, `/GenerateAuthorizeToken`, `/GetAccountsDetail`, `/GetAccountsSummary`, `/GetStatements`
- Key identifiers: `loginId` (permanent connection token), `requestId` (session token), `customerId` (account identifier)
- Credentials: secret key, authorize token, x-api-key, HMAC secret
- Primary docs: https://docs.flinks.com

## When to use

**Reach for this skill when:**
- Building an account linking flow to connect end-user bank accounts (use Flinks Connect iframe or Flinks Express)
- Retrieving account data, balances, transactions, or statements after a user connects
- Setting up payment processing (EFT debit or Interac e-Transfer)
- Enriching raw transaction data with financial attributes (income, credit risk, lending insights)
- Uploading and processing bank statements or financial documents
- Implementing webhooks to receive data asynchronously instead of polling
- Troubleshooting authentication, MFA, or data retrieval issues
- Testing integrations in sandbox before going to production
- Managing nightly automatic data refreshes for connected accounts

**Do not use for:** Account creation, user authentication (Flinks handles this), payment settlement reconciliation (use Dashboard), or non-financial data.

## Quick reference

### Authentication flow

| Step | Action | Header/Parameter | Value |
|------|--------|------------------|-------|
| 1 | Generate token | `POST /GenerateAuthorizeToken` | Pass `flinks-auth-key: {secret-key}` |
| 2 | Authenticate session | `POST /Authorize` | Pass `flinks-auth-key: {authorize-token}` in header; get `requestId` back |
| 3 | Call data endpoints | `POST /GetAccountsDetail` | Pass `x-api-key: {x-api-key}` header; use `requestId` in body |

### Key identifiers

| Identifier | Lifetime | Use case |
|------------|----------|----------|
| `loginId` | Permanent (until `/DeleteCard` called) | Stored on your server; represents saved connection to one bank account |
| `requestId` | Session (8 min inactivity or 30 min processing) | Temporary; grants access to data endpoints; consumed by `/GetAccountsDetail`, `/GetAccountsDetailAsync`, `/GetStatements` |
| `customerId` | Permanent | Your account ID; included in every API URL path |
| `authorize token` | Single-use (15 min expiry) | Generated from secret key; passed to `/Authorize` or Flinks Connect iframe |

### Common endpoints

| Endpoint | Method | Purpose | Consumes requestId? |
|----------|--------|---------|---------------------|
| `/Authorize` | POST | Open session, exchange `loginId` for `requestId` | No |
| `/GetAccountsDetail` | POST | Retrieve full account data (KYC, transactions, balances) | Yes |
| `/GetAccountsDetailAsync` | GET | Poll for pending data (returns 202 until ready) | No |
| `/GetAccountsSummary` | POST | Get account balances and basic info only | No |
| `/GetStatements` | POST | Request PDF statements from institution | Yes |
| `/SetScheduledRefresh` | PATCH | Enable/disable nightly automatic refreshes | No |
| `/DeleteCard` | DELETE | Permanently delete all data for a `loginId` | No |

### Flinks Connect iframe parameters

| Parameter | Type | Purpose |
|-----------|------|---------|
| `authorizeToken` | string | Required; pass your generated authorize token |
| `redirectUrl` | URL | Where to send user after successful connection |
| `demo=true` | boolean | Enable sandbox mode (Flinks Capital test institution only) |
| `consentEnable` | boolean | Show/hide consent screen (default: true) |
| `headerEnable` | boolean | Show/hide Flinks logo header (default: true) |
| `scheduleRefresh` | boolean | Enable nightly automatic refreshes (default: false) |
| `Tag` | string | Custom tag to include in webhook payload for reconciliation |

### Sandbox credentials (Toolbox)

Use these shared credentials for testing only:
- **Base URL:** `https://toolbox-api.private.fin.ag/` and `https://toolbox-iframe.private.fin.ag/`
- **customerId:** `43387ca6-0391-4c82-857d-70d95f087ecb`
- **Test institution:** Flinks Capital
- **Test username:** `Greatday`
- **Test password:** `Everyday`
- **Note:** Add `demo=true` to iframe URL to enable test institution

## Decision guidance

### When to use cached mode vs. live mode

| Scenario | Mode | Parameter | Reason |
|----------|------|-----------|--------|
| Retrieving already-collected data (e.g., for Attributes) | Cached | `MostRecentCached: true` | Faster; no new bank connection needed |
| Daily refresh using nightly refresh data | Cached | `MostRecentCached: true` | Nightly job already collected fresh data |
| User manually requesting fresh data | Live | `MostRecentCached: false, Save: true` | Forces new connection to bank; updates stored data |
| First-time data retrieval after connection | Live | `MostRecentCached: false, Save: true` | Must fetch from bank; save for future use |

### When to use Flinks Connect vs. Flinks Express

| Factor | Flinks Connect | Flinks Express |
|--------|----------------|-----------------|
| **Development resources** | Required (in-house) | Not required (hosted by Flinks) |
| **Customization** | Full control; iframe on your site | Limited; Flinks-managed branding |
| **Setup time** | Longer; more configuration | Faster; template-based |
| **Use case** | Custom integrations; full control needed | Quick launch; minimal dev resources |

### When to use polling vs. webhooks

| Approach | Use when | Trade-off |
|----------|----------|-----------|
| **Polling** (`/GetAccountsDetailAsync`) | Testing; low-volume requests | More API calls; higher latency |
| **Webhooks** | Production; real-time data delivery | Requires HTTPS endpoint; signature validation |

### When to use GetAccountsSummary vs. GetAccountsDetail

| Endpoint | Returns | Use when |
|----------|---------|----------|
| `/GetAccountsSummary` | Balances, account category, EFT eligibility | Quick balance check; does not consume `requestId` |
| `/GetAccountsDetail` | Full KYC, transactions, statements, balances | Need transaction history; consumes `requestId` |

## Workflow

### 1. Set up authentication and generate authorize token

1. Receive `secret key`, `x-api-key`, `customerId`, and `HMAC secret` from Flinks during onboarding.
2. Store these securely on your backend (never expose in frontend code).
3. When a user initiates connection, call `/GenerateAuthorizeToken` with your `secret key` in the `flinks-auth-key` header.
4. Receive a one-time `authorize token` (valid 15 minutes).
5. Pass the `authorize token` to Flinks Connect iframe (URL parameter) or to `/Authorize` endpoint (header).

### 2. Connect user account via Flinks Connect

1. Embed Flinks Connect iframe in your page with `authorizeToken` parameter and `demo=true` (sandbox only).
2. User selects their bank and enters credentials.
3. Flinks handles MFA automatically; user is redirected to your `redirectUrl` on success.
4. Flinks emits a JavaScript event with the `loginId`; capture and store it securely on your backend.
5. Save the `loginId` to your database (tied to your internal user ID).

### 3. Retrieve account data

1. Call `/Authorize` with the stored `loginId` and `MostRecentCached: true` (cached) or `false` (live).
2. Receive a `requestId` in the response.
3. Call `/GetAccountsDetail` with the `requestId` and `x-api-key` header.
4. If response is `202 OPERATION_PENDING`, poll `/GetAccountsDetailAsync` every 10 seconds (max 30 minutes).
5. When `200` response received, parse the account data (KYC, transactions, balances).

### 4. Set up nightly refresh (optional)

1. Call `/SetScheduledRefresh` with `loginId` and `isScheduledRefresh: true`.
2. Flinks automatically refreshes data nightly (4–8 AM UTC) for eligible accounts.
3. Monitor with `/GetNightlyRefreshStatus` to catch failures.
4. If refresh fails, prompt user to reconnect via Flinks Connect.

### 5. Enrich data with Attributes (optional)

1. After `/GetAccountsDetail` completes, call `/Authorize` with `MostRecentCached: true` to open a new session.
2. Call the appropriate Attributes endpoint (e.g., `/GetIncomeAttributes`, `/GetLendingAttributes`).
3. Parse the returned attributes (e.g., income stability, credit risk score).
4. Use attributes in your underwriting or decision logic.

### 6. Set up webhooks (optional, recommended for production)

1. Open a support ticket with your webhook URL and instance (sandbox/production).
2. Flinks configures your instance to send POST callbacks to your URL.
3. Implement signature validation using HMAC-SHA256 with your `HMAC secret`.
4. Listen for webhook types: KYC, GetAccountsDetail, Flinks Pay Events, Upload Fraud Alerts.
5. Respond with HTTP 200 to confirm receipt; Flinks retries up to 10 times if you don't.

## Common gotchas

- **Confusing secret key and authorize token:** The secret key generates tokens; the authorize token authenticates sessions. Using the wrong value in `flinks-auth-key` causes `401 ACCESS_DENIED`.
- **Forgetting `demo=true` in sandbox:** Flinks Connect iframe won't show the test institution (Flinks Capital) without this parameter.
- **Not handling 202 OPERATION_PENDING:** Data retrieval is asynchronous. Your code must poll `/GetAccountsDetailAsync` or listen for webhooks; a 202 response is normal, not an error.
- **Reusing a consumed requestId:** `/GetAccountsDetail`, `/GetAccountsDetailAsync`, and `/GetStatements` consume the `requestId`. Subsequent calls with the same `requestId` return `401 SESSION_EXPIRED`. Call `/Authorize` again for a new `requestId`.
- **Exposing credentials in frontend code:** Never pass your secret key or `x-api-key` to the browser. Generate authorize tokens on your backend only.
- **Nightly refresh not working:** Nightly refresh only works at institutions that allow reconnection without MFA. Most Canadian banks require MFA on every login, so nightly refresh has limited coverage. Build a manual refresh flow as a fallback.
- **Webhook signature validation:** Always verify the `X-Webhook-Signature` header using HMAC-SHA256 over the raw request body (not parsed JSON). Compare case-insensitively and in constant time.
- **Forgetting to delete data:** Call `/DeleteCard` when a user revokes consent or deletes their account. This permanently removes all stored credentials and data for that `loginId`.
- **Mixing sandbox and production credentials:** Each environment has separate credentials and base URLs. Verify you're using the correct instance before going live.
- **Attributes called before GetAccountsDetail completes:** Attributes require fresh transaction data. If you call an Attributes endpoint while `/GetAccountsDetail` is still processing, you'll get `202 OPERATION_PENDING`. Wait for `/GetAccountsDetail` to complete first.

## Verification checklist

Before submitting work with Flinks:

- [ ] **Authentication:** Verify `flinks-auth-key` header uses the correct value (secret key for `/GenerateAuthorizeToken`, authorize token for `/Authorize`).
- [ ] **Credentials stored securely:** Secret key, `x-api-key`, and `HMAC secret` are stored on backend only; never exposed in frontend code.
- [ ] **Authorize token handling:** Token is generated fresh for each session and passed to Flinks Connect iframe or `/Authorize` endpoint.
- [ ] **RequestId lifecycle:** Confirm you're calling `/Authorize` again after a completing call (`/GetAccountsDetail`, `/GetStatements`) consumes the `requestId`.
- [ ] **Async handling:** Code handles `202 OPERATION_PENDING` responses and polls or listens for webhooks; does not assume synchronous responses.
- [ ] **Sandbox testing:** Iframe includes `demo=true` and uses Toolbox credentials; production code removes `demo=true`.
- [ ] **Webhook signature validation:** HMAC-SHA256 signature is verified on every incoming webhook using the raw request body and your `HMAC secret`.
- [ ] **Error handling:** Code catches and logs Flinks error codes (e.g., `SESSION_EXPIRED`, `OPERATION_PENDING`, `INVALID_LOGIN`); user-facing messages are clear.
- [ ] **Data deletion:** `/DeleteCard` is called when user revokes consent or deletes their account.
- [ ] **Nightly refresh fallback:** If using nightly refresh, a manual refresh flow is available for users whose accounts fail to refresh.
- [ ] **Instance verification:** Base URLs and credentials match the intended environment (sandbox vs. production).

## Resources

- **Comprehensive page listing:** https://docs.flinks.com/llms.txt
- **Getting Started:** https://docs.flinks.com/guides/getting-started/about-flinks
- **API Reference (Connect):** https://docs.flinks.com/api/connect/getting-started
- **Flinks Connect Setup:** https://docs.flinks.com/guides/connect/flinks-connect/flinks-connect
- **Authentication Reference:** https://docs.flinks.com/guides/connect/authentication-reference
- **Key Concepts (LoginId vs RequestId):** https://docs.flinks.com/guides/getting-started/key-concepts
- **Webhooks Setup:** https://docs.flinks.com/guides/webhooks/introduction
- **Error Codes:** https://docs.flinks.com/api/authorize/error-codes

---

> For additional documentation and navigation, see: https://docs.flinks.com/llms.txt