> ## Documentation Index
> Fetch the complete documentation index at: https://docs.flinks.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Accounts

> Use the /api/fdx/5/accounts endpoint to get a list of customer accounts in FDX format.

Use the `/api/fdx/5/accounts` endpoint to get a list of customer accounts in FDX format.

To successfully call this endpoint, you must first call the [/Token](/api/outbound/endpoints/authorize/token) endpoint to obtain a valid `access_token` using:

* grant\_type: `authorization_code` or `refresh_token`
* client\_id: `{recipient client_id}`
* client\_secret: `{recipient client_secret}`
* redirect\_uri: `{recipient redirect_uri}`
* code: `{with grant type authorization_code}`
* refresh\_token: `{with grant type refresh_token}`

## Result types

The `resultType` query parameter controls the level of detail returned:

| Value                   | Description                                                                                                                                                          |
| :---------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `lightweight` (default) | Returns metadata fields only: `accountId`, `accountCategory`, `accountType`, `accountNumberDisplay`, `productName`, `nickname`, `status`, `description`, `currency`. |
| `details`               | Returns the full account record including balances, interest rates, transactions, and routing information.                                                           |

<Warning>
  The `routingTransitNumber` field is only returned when `resultType=details`. If you need routing/transit numbers, you must explicitly request the details result type.
</Warning>

## How to handle an error response

If you receive an error response, refer to the [List of Data Access Errors](/api/outbound/endpoints/fdx/fdx-errors) for more information about the error and how to resolve it.

<Note>
  <p class="h4">Response is different for each Data Provider</p>

  This endpoint returns different fields for each Data Provider. For more information about the fields that each Data Provider supports, review the [Data Provider's details](/api/outbound/endpoints/registration/a-data-recipient).
</Note>

<ResponseExample>
  ```json 200 - OK theme={null}
  {
    "page": {
      "nextOffset": "string",
      "totalElements": 10
    },
    "links": {
      "next": {
        "href": "string",
        "action": "string",
        "description": "string"
      }
    },
    "accounts": [
      {
        "depositAccount": {
          "accountId": "string",
          "accountCategory": "DEPOSIT_ACCOUNT",
          "accountType": "CHECKING",
          "accountNumber": "string",
          "accountNumberDisplay": "string",
          "productName": "string",
          "nickname": "string",
          "status": "OPEN",
          "description": "string",
          "currency": {
            "currencyRate": 1.0,
            "currencyCode": "USD",
            "originalCurrencyCode": "USD"
          },
          "routingTransitNumber": "string",
          "balanceType": "ASSET",
          "interestRate": 1.5,
          "interestRateType": "FIXED",
          "transferIn": true,
          "transferOut": true,
          "lastActivityDate": "2024-01-15",
          "transactionsIncluded": true,
          "balanceAsOf": "2024-01-15T10:30:00Z",
          "currentBalance": 5000.5,
          "availableBalance": 4500.0,
          "annualPercentageYield": 1.25,
          "interestYtd": 25.0,
          "transactions": [
            {
              "accountId": "string",
              "transactionId": "string",
              "postedTimestamp": "2024-01-14T09:00:00Z",
              "transactionTimestamp": "2024-01-14T09:00:00Z",
              "description": "Direct Deposit",
              "debitCreditMemo": "CREDIT",
              "amount": 1500.0,
              "status": "POSTED",
              "transactionType": "DEPOSIT",
              "payee": "Employer Inc."
            }
          ]
        }
      }
    ]
  }
  ```

  ```json 200 - With Paging theme={null}
  {
    "page": {
      "nextOffset": "<opaque>",
      "totalElements": 6
    },
    "links": {
      "next": {
        "href": "https://ob-preprod.flinksapp.dev/api/fdx/5/accounts?limit=1&offset=<opaque>",
        "action": null,
        "description": null
      }
    },
    "accounts": [
      {
        "locAccount": {
          "accountId": "11",
          "accountType": "CREDITCARD",
          "accountNumber": "4200240024244242",
          "accountNumberDisplay": "4200240024244242",
          "productName": "Product Name Credit Card",
          "nickname": "Credit Card",
          "status": "OPEN",
          "description": "Credit Card",
          "currency": {
            "currencyCode": "CAD"
          }
        }
      }
    ]
  }
  ```

  ```json 4XX - Result theme={null}
  {
    "code": 400,
    "message": "message",
    "debugMessage": "Provider custom developer-level error details for troubleshooting"
  }
  ```

  ```json 5XX - Result theme={null}
  {
    "code": 500,
    "message": "message",
    "debugMessage": "Provider custom developer-level error details for troubleshooting"
  }
  ```
</ResponseExample>


## OpenAPI

````yaml /openapi-outbound.yaml GET /api/fdx/5/accounts
openapi: 3.0.3
info:
  title: Flinks API
  description: >
    Flinks API provides financial data connectivity, enrichment, and payment
    solutions.


    ## Authentication

    Endpoints require authentication using `flinks-auth-key` header (Bearer
    token).


    For more information, visit: https://docs.flinks.com
  version: 3.0.0
  contact:
    name: Flinks Support
    url: https://www.flinks.com/contact/sales
  termsOfService: https://www.flinks.com
servers:
  - url: https://ob.flinksapp.com
    description: Flinks Outbound Production
security:
  - BearerAuth: []
tags:
  - name: Authorization
    description: Endpoints for generating authorization tokens and authenticating requests
paths:
  /api/fdx/5/accounts:
    get:
      tags:
        - FDX
      summary: Get Accounts
      description: >-
        Use the /api/fdx/5/accounts endpoint to get a list of customer accounts
        in FDX format.
      operationId: fdxGetAccounts
      parameters:
        - name: accountIds
          in: query
          required: false
          description: >-
            The ID of the customer account that you want to retrieve. If you are
            requesting more than one account, separate each accountId with a
            comma.
          schema:
            type: string
        - name: resultType
          in: query
          required: false
          description: >-
            Specify the type of results you want to see. Possible values include
            the following: - `lightweight` = Return the metadata fields only -
            `details` = Return a full list of details The default value of this
            parameter is `lightweight`.
          schema:
            type: string
        - name: offset
          in: query
          required: false
          description: >-
            An opaque cursor returned by the provider and used to retrieve the
            next page of results. Clients should pass this value unchanged to
            continue fetching data. The format of the string is internal and
            should not be interpreted or modified.
          schema:
            type: string
        - name: limit
          in: query
          required: false
          description: >-
            The maximum number of accounts that you want to return with this
            request. Use this field to set a limit on the amount of data you
            receive.
          schema:
            type: string
      responses:
        '200':
          description: Returned when the accounts are successfully retrieved.
          content:
            application/json:
              schema:
                type: object
                properties:
                  page:
                    type: object
                    description: Pagination information for the response.
                    properties:
                      nextOffset:
                        type: string
                        description: Opaque cursor for retrieving the next page of results.
                      totalElements:
                        type: integer
                        description: Total number of elements available.
                  links:
                    type: object
                    description: Links for pagination.
                    properties:
                      next:
                        type: object
                        description: Link to the next page of results.
                        properties:
                          href:
                            type: string
                            description: URL for the next page.
                          action:
                            type: string
                            description: Action type for the link.
                          description:
                            type: string
                            description: Description of the link.
                  accounts:
                    type: array
                    description: List of customer accounts.
                    items:
                      type: object
                      properties:
                        depositAccount:
                          type: object
                          description: >-
                            Deposit account details, returned for
                            checking/savings accounts.
                          properties:
                            accountId:
                              type: string
                              description: Unique identifier for the account.
                            accountCategory:
                              type: string
                              description: >-
                                Category of the account (e.g., DEPOSIT_ACCOUNT,
                                LOAN_ACCOUNT).
                            accountType:
                              type: string
                              description: Type of the account (e.g., CHECKING, SAVINGS).
                            accountNumber:
                              type: string
                              description: Full account number.
                            accountNumberDisplay:
                              type: string
                              description: Masked account number for display purposes.
                            productName:
                              type: string
                              description: Name of the product.
                            nickname:
                              type: string
                              description: User-assigned nickname for the account.
                            status:
                              type: string
                              description: Status of the account (e.g., OPEN, CLOSED).
                            description:
                              type: string
                              description: Description of the account.
                            currency:
                              type: object
                              description: Currency information for the account.
                            fiAttributes:
                              type: array
                              items:
                                type: object
                              description: Financial institution-specific attributes.
                            parentAccountId:
                              type: string
                              description: ID of the parent account, if applicable.
                            lineOfBusiness:
                              type: string
                              description: Line of business for the account.
                            routingTransitNumber:
                              type: string
                              description: Routing/transit number for the account.
                            balanceType:
                              type: string
                              description: Type of balance (ASSET or LIABILITY).
                            interestRate:
                              type: number
                              description: Interest rate for the account.
                            interestRateType:
                              type: string
                              description: Type of interest rate (FIXED or VARIABLE).
                            interestRateAsOf:
                              type: string
                              description: Date when the interest rate was last set.
                            priorInterestRate:
                              type: number
                              description: Previous interest rate.
                            transferIn:
                              type: boolean
                              description: >-
                                Indicates if transfers into this account are
                                allowed.
                            transferOut:
                              type: boolean
                              description: >-
                                Indicates if transfers out of this account are
                                allowed.
                            micrNumber:
                              type: string
                              description: MICR number for the account.
                            lastActivityDate:
                              type: string
                              description: Date of last activity on the account.
                            transactionsIncluded:
                              type: boolean
                              description: >-
                                Indicates if transactions are included in the
                                response.
                            balanceAsOf:
                              type: string
                              description: Date and time of the balance.
                            currentBalance:
                              type: number
                              description: Current balance of the account.
                            openingDayBalance:
                              type: number
                              description: Opening day balance.
                            availableBalance:
                              type: number
                              description: Available balance for use.
                            annualPercentageYield:
                              type: number
                              description: Annual percentage yield.
                            interestYtd:
                              type: number
                              description: Year-to-date interest earned.
                            term:
                              type: number
                              description: Term of the account.
                            maturityDate:
                              type: string
                              description: Maturity date for term accounts.
                            transactions:
                              type: array
                              items:
                                type: object
                              description: List of transactions for the account.
                        loanAccount:
                          type: object
                          description: Loan account details, returned for loan accounts.
                          properties:
                            accountId:
                              type: string
                              description: Unique identifier for the account.
                            accountCategory:
                              type: string
                              description: Category of the account.
                            accountType:
                              type: string
                              description: Type of the account.
                            principalBalance:
                              type: number
                              description: Principal balance of the loan.
                            escrowBalance:
                              type: number
                              description: Escrow balance.
                            originalPrincipal:
                              type: number
                              description: Original principal amount.
                            originatingDate:
                              type: string
                              description: Date the loan originated.
                            loanTerm:
                              type: integer
                              description: Term of the loan in months.
                            totalNumberOfPayments:
                              type: number
                              description: Total number of payments.
                            nextPaymentAmount:
                              type: number
                              description: Amount of the next payment.
                            nextPaymentDate:
                              type: string
                              description: Date of the next payment.
                            paymentFrequency:
                              type: string
                              description: Frequency of payments (MONTHLY, ANNUALLY, etc.).
                            compoundingPeriod:
                              type: string
                              description: Compounding period.
                            payOffAmount:
                              type: number
                              description: Payoff amount.
                            lastPaymentAmount:
                              type: number
                              description: Amount of the last payment.
                            lastPaymentDate:
                              type: string
                              description: Date of the last payment.
                            maturityDate:
                              type: string
                              description: Maturity date of the loan.
                            interestPaidYearToDate:
                              type: number
                              description: Interest paid year to date.
                            transactions:
                              type: array
                              items:
                                type: object
                              description: List of transactions for the account.
                        locAccount:
                          type: object
                          description: Line of credit account details.
                          properties:
                            creditLine:
                              type: number
                              description: Total credit line.
                            availableCredit:
                              type: number
                              description: Available credit.
                            principalBalance:
                              type: number
                              description: Principal balance.
                            currentBalance:
                              type: number
                              description: Current balance.
                            nextPaymentAmount:
                              type: number
                              description: Amount of the next payment.
                            nextPaymentDate:
                              type: string
                              description: Date of the next payment.
                            minimumPaymentAmount:
                              type: number
                              description: Minimum payment amount.
                            lastStmtBalance:
                              type: number
                              description: Last statement balance.
                            lastStmtDate:
                              type: string
                              description: Date of the last statement.
                        investmentAccount:
                          type: object
                          description: Investment account details.
                          properties:
                            currentValue:
                              type: number
                              description: Current value of the account.
                            availableCashBalance:
                              type: number
                              description: Available cash balance.
                            margin:
                              type: boolean
                              description: Indicates if margin trading is enabled.
                            marginBalance:
                              type: number
                              description: Margin balance.
                            shortBalance:
                              type: number
                              description: Short balance.
                            rolloverAmount:
                              type: number
                              description: Rollover amount.
                            employerName:
                              type: string
                              description: Employer name (for retirement accounts).
                            holdings:
                              type: array
                              items:
                                type: object
                              description: List of holdings in the account.
                            transactions:
                              type: array
                              items:
                                type: object
                              description: List of transactions.
                            openOrders:
                              type: array
                              items:
                                type: object
                              description: List of open orders.
                        annuityAccount:
                          type: object
                          description: Annuity account details.
                          properties:
                            payoutType:
                              type: string
                              description: Type of payout (DEFERRED, IMMEDIATE).
                            policyProductType:
                              type: string
                              description: Product type (FIXED, VARIABLE).
                            payoutMode:
                              type: string
                              description: Payout mode (ANNUALLY, MONTHLY, etc.).
                            payoutAmount:
                              type: number
                              description: Payout amount.
                            payoutStartDate:
                              type: string
                              description: Payout start date.
                            payoutEndDate:
                              type: string
                              description: Payout end date.
                            surrenderValue:
                              type: number
                              description: Surrender value.
        4XX:
          description: >-
            Returned when the request contains invalid data or authentication
            fails.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: Error code.
                  message:
                    type: string
                    description: A description of the error.
                  debugMessage:
                    type: string
                    description: >-
                      Provider custom developer-level error details for
                      troubleshooting.
        5XX:
          description: Returned when an internal server error occurred.
          content:
            application/json:
              schema:
                type: object
                properties:
                  code:
                    type: integer
                    description: Error code.
                  message:
                    type: string
                    description: A description of the error.
                  debugMessage:
                    type: string
                    description: >-
                      Provider custom developer-level error details for
                      troubleshooting.
components:
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: Bearer token obtained from the /Token endpoint.

````