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

# Search for statements

> Get account statements.




## OpenAPI

````yaml /openapi/fdx.yml get /fdx/v6/customer/{customerId}/accounts/{accountId}/statements
openapi: 3.0.3
info:
  version: 1.0.0
  title: Fiskil FDX API
  description: >
    The Fiskil FDX API is a subset of the FDX API specification suited to most
    Open Finance use cases. You must implement this API and configure it as your
    Data Provider's

    [Resource Server](/guide/resource_server) so your Data Provider can return
    the appropriate data once an authorisation has been created.

    ## FDX compliance


    The Fiskil FDX API specifications are a subset of the Financial Data
    Exchange (FDX) API specification, the usage thereof (or any part thereof)
    constitutes acceptance of the FDX API

    License Agreement, which can be found at https://financialdataexchange.org/.
    The FDX API specification is distributed exclusively by FDX. Modifications
    to eliminate required or

    conditional elements prescribed in the FDX API Certification Use Cases will
    render any implementations using said modifications non-conformant with the
    FDX API Certification Use Cases.

    Please note that building the FDX-compliant Data Provider API and permitting
    Fiskil to call your build constitutes acceptance of

    the FDX end user license agreement, which can be found at
    https://financialdataexchange.org/.

    The full FDX API standard specification is distributed exclusively by FDX.


    ## Error handling

    When handling errors in your API it is important you return the error
    structures defined in this specification so that your responses remain FDX
    compliant. Each API defines the

    various error conditions that you may encounter and how to represent them.
  contact:
    name: Fiskil Support
    url: https://fiskil.com
    email: support@fiskil.com.au
servers:
  - url: https://api.provider.fiskil.com
security:
  - bearerAuth: []
paths:
  /fdx/v6/customer/{customerId}/accounts/{accountId}/statements:
    get:
      tags:
        - Account Statements
      summary: Search for statements
      description: |
        Get account statements.
      operationId: searchForAccountStatements
      parameters:
        - $ref: '#/components/parameters/CustomerIdPath'
        - $ref: '#/components/parameters/AccountIdPath'
        - $ref: '#/components/parameters/OffsetQuery'
        - $ref: '#/components/parameters/LimitQuery'
        - $ref: '#/components/parameters/StartTimeQuery'
        - $ref: '#/components/parameters/EndTimeQuery'
      responses:
        '200':
          description: |
            Paginated list of available statements
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Statements'
              example:
                page:
                  nextOffset: B47D80MVP23T
                  totalElements: 3
                statements:
                  - accountId: '10001'
                    statementId: '20001'
                    statementDate: '2024-01-15'
                    description: January 2024 Monthly Statement
                    links:
                      - href: /accounts/10001/statements/20001
                        rel: self
                        action: GET
                        types:
                          - application/pdf
                      - href: /accounts/10001/statements/20001/download
                        rel: download
                        action: GET
                        types:
                          - application/pdf
                    status: AVAILABLE
                  - accountId: '10001'
                    statementId: '20002'
                    statementDate: '2024-02-15'
                    description: February 2024 Monthly Statement
                    links:
                      - href: /accounts/10001/statements/20002
                        rel: self
                        action: GET
                        types:
                          - application/pdf
                    status: PROCESSING
        '404':
          $ref: '#/components/responses/responseErrorCustomerIdNotFound'
        '409':
          description: |
            Account is closed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountIsClosedError'
        '422':
          description: |
            Account type not supported
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountTypeNotSupportedError'
        '500':
          description: |
            Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
        '503':
          description: |
            Scheduled maintenance
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ScheduledMaintenanceError'
components:
  parameters:
    CustomerIdPath:
      name: customerId
      in: path
      description: >
        Unique identifier for the user the account belongs to. This will be the
        user that authorized the data sharing.
      required: true
      schema:
        $ref: '#/components/schemas/Identifier'
    AccountIdPath:
      name: accountId
      in: path
      description: >
        Account identifier, found in the `GET /accounts` endpoint response.


        **Note:** If the status of the `accountId` provided is `RESTRICTED`, you
        can send a 200 response with an empty body to indicate that no payment
        networks are available at this time.
      required: true
      schema:
        $ref: '#/components/schemas/Identifier'
    OffsetQuery:
      name: offset
      in: query
      description: >
        An opaque ID that indicates there is at least one more page of data
        available. This value does not need to be numeric or have any specific
        pattern. If provided, the Data Provider will use this value to send a
        new request and retrieve the next page. Omitting this value indicates
        that there is no more data to retrieve.
      schema:
        type: string
        example: qwer123454q2f
    LimitQuery:
      name: limit
      in: query
      description: >
        The number of elements that the API consumer wishes to receive. To
        retrieve multiple pages, the Data Provider will use the opaque
        `nextOffset` field to send a subsequent request until the `nextOffset`
        is no longer included.
      schema:
        type: integer
    StartTimeQuery:
      name: startTime
      in: query
      description: >
        Start time for use in retrieval of elements (ISO 8601). For
        transactions, this should filter by the `postedTimestamp` of the
        transaction
      schema:
        $ref: '#/components/schemas/DateString'
    EndTimeQuery:
      name: endTime
      in: query
      description: >
        End time for use in retrieval of elements (ISO 8601). For transactions,
        this should to filter by the `postedTimestamp` of the transaction
      schema:
        $ref: '#/components/schemas/DateString'
  schemas:
    Statements:
      title: Statements entity
      description: |
        A paginated array of account statements
      type: object
      allOf:
        - $ref: '#/components/schemas/PaginatedArray'
        - type: object
          properties:
            statements:
              type: array
              description: >
                An array of statements, each with its own HATEOAS link to
                retrieve the account statement
              items:
                $ref: '#/components/schemas/Statement'
          required:
            - statements
    AccountIsClosedError:
      title: Account Is Closed Error
      description: Error response when the API does not support closed accounts
      type: object
      properties:
        code:
          type: integer
          description: |
            FDX Error code for account is closed
          enum:
            - 705
          example: 705
        message:
          type: string
          description: >
            End user displayable information which might help the customer
            diagnose an error
        debugMessage:
          type: string
          description: >
            Message used to debug the root cause of the error. Provider can
            include an error GUID in message for their use
      required:
        - code
        - message
      example:
        code: 705
        message: Account is closed
        debugMessage: Operation is not supported by the closed account
    AccountTypeNotSupportedError:
      title: Account Type Not Supported Error
      description: >-
        Error response when the API does not supported the type of account
        requested
      type: object
      properties:
        code:
          type: integer
          description: |
            FDX Error code for account type not supported
          enum:
            - 704
          example: 704
        message:
          type: string
          description: >
            End user displayable information which might help the customer
            diagnose an error
        debugMessage:
          type: string
          description: >
            Message used to debug the root cause of the error. Provider can
            include an error GUID in message for their use
      required:
        - code
        - message
      example:
        code: 704
        message: Account type not supported
        debugMessage: The account type does not support the selected action
    InternalServerError:
      title: Internal Server Error
      description: Error response for internal server errors
      type: object
      properties:
        code:
          type: integer
          description: |
            FDX Error code for internal server error
          enum:
            - 500
          example: 500
        message:
          type: string
          description: >
            End user displayable information which might help the customer
            diagnose an error
        debugMessage:
          type: string
          description: >
            Message used to debug the root cause of the error. Provider can
            include an error GUID in message for their use
      required:
        - code
        - message
      example:
        code: 500
        message: Internal server error
        debugMessage: Provider custom developer-level error details for troubleshooting
    ScheduledMaintenanceError:
      title: Scheduled Maintenance Error
      description: Error response when system is under scheduled maintenance
      type: object
      properties:
        code:
          type: integer
          description: |
            FDX Error code for scheduled maintenance
          enum:
            - 503
          example: 503
        message:
          type: string
          description: >
            End user displayable information which might help the customer
            diagnose an error
        debugMessage:
          type: string
          description: >
            Message used to debug the root cause of the error. Provider can
            include an error GUID in message for their use
      required:
        - code
        - message
      example:
        code: 503
        message: Scheduled maintenance
        debugMessage: >-
          System is down for maintenance. Retry-After HTTP header may be used to
          communicate estimated time of recovery
    Identifier:
      title: Identifier
      description: |
        Value for a unique identifier
      type: string
      maxLength: 256
      example: someLongTermUniqueIDString
    DateString:
      title: Date String
      description: >
        ISO 8601 full-date in format 'YYYY-MM-DD' according

        to [IETF
        RFC3339](https://datatracker.ietf.org/doc/html/rfc3339.html#section-5.6)
      type: string
      format: date
      maxLength: 10
      example: '2021-07-15'
    PaginatedArray:
      title: Paginated Array
      description: |
        Base class for results that may be paginated
      type: object
      properties:
        page:
          $ref: '#/components/schemas/PageMetadata'
    Statement:
      title: Statement entity
      description: |
        An account statement
      type: object
      properties:
        accountId:
          $ref: '#/components/schemas/Identifier'
          description: |
            Corresponds to `accountId` in Account entity
        statementId:
          $ref: '#/components/schemas/Identifier'
          description: >
            Long-term persistent identity of the statement. This identity must
            be unique within your organization
        statementDate:
          $ref: '#/components/schemas/DateString'
          description: |
            The date the statement becomes available to be viewed by the user
        description:
          type: string
          description: |
            Description of the statement
        links:
          $ref: '#/components/schemas/HateoasLinks'
          description: >
            The HATEOAS links to retrieve this account statement, or to invoke
            other APIs.
        status:
          type: string
          description: |
            Availability status of statement
          enum:
            - AVAILABLE
            - PROCESSING
            - FAILED
    GenericError:
      example:
        error: An error message
      type: object
      properties:
        error:
          type: string
          description: A message describing what caused the error
      required:
        - error
    PageMetadata:
      title: Page Metadata
      description: >
        Contains the opaque identifier, `nextOffset`, to indicate a paginated
        result set.
      type: object
      properties:
        nextOffset:
          type: string
          example: B47D80MVP23T
          description: |
            Opaque offset identifier
        totalElements:
          type: integer
          example: 3
          description: |
            Total number of elements
    HateoasLinks:
      title: HATEOAS links array
      description: |
        An array of HATEOAS links
      type: array
      items:
        $ref: '#/components/schemas/HateoasLink'
    HateoasLink:
      title: HATEOAS Link
      description: |
        HATEOAS (Hypermedia As The Engine Of Application State) link
      required:
        - href
      type: object
      properties:
        href:
          type: string
          format: uri-reference
          description: |
            The resource URL
          example: https://api.fi.com/fdx/v4/accounts/12345
        action:
          $ref: '#/components/schemas/HttpAction'
          description: |
            The HTTP method to use for the request
        rel:
          description: >
            The relation of this link to its containing entity, as defined by
            the [IETF RFC5988](https://datatracker.ietf.org/doc/html/rfc5988)
          type: string
        types:
          type: array
          items:
            $ref: '#/components/schemas/ContentTypes'
          description: |
            The content-types that can be used in the Accept header.
    HttpAction:
      title: HTTP action type
      description: |
        The HTTP method to use for requests
      type: string
      enum:
        - GET
        - POST
        - PATCH
        - DELETE
        - PUT
    ContentTypes:
      title: Content Types
      description: |
        Types of document formats.
      type: string
      enum:
        - application/pdf
  responses:
    responseErrorCustomerIdNotFound:
      description: The customer ID in the URL path is invalid or not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/GenericError'
            example:
              error: Customer not found
  securitySchemes:
    bearerAuth:
      description: >
        The Fiskil Data Provider will include a self-signed JWT as a Bearer
        token in the `Authorization` header.

        You should verify this JWT using the JWKS URL you can find for your Data
        Provider instance in the Fiskil

        Console. To verify the JWT you **must**:
          * Verify the signature
          * Ensure the token has not expired by checking the `exp` claim
          * The `sub` and `iss` claims are your data provider subdomain
          * The `aud` claim is the URI of the resource being requested (excluding any query parameters)
          * The `jti` value is unique
        For further detail on security and authentication refer to our
        [Authentication](/TODO) documentation
      type: http
      scheme: bearer
      bearerFormat: JWT

````