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

# Retrieve a list of the client's balances

Get all balances for all accounts for a given client.


## OpenAPI

````yaml /openapi.json get /balances
openapi: 3.0.0
info:
  description: |
    Ebury API allows customers:
      to retrieve accounts, balances, beneficiaries, and transactions;
      to get buy/sell estimates and quotes, book trades and retrieve trade history;
      to allocate payments to a trade and beneficiary, and to submit payments in bulk;
      to download documents such as trade receipt, payment instruction and payment receipt;
      to manage the authorised persons on their account.
    The Metadata API allows applications to clarify some parts of the Ebury API
      that are impractical to express schematically.
  termsOfService: https://docs.ebury.io/#terms-of-use
  title: Ebury API
  version: '0.1'
servers:
  - url: https://{environment}.ebury.io
    variables:
      environment:
        default: api
        enum:
          - api
          - sandbox
security:
  - api_key: []
paths:
  /balances:
    get:
      tags:
        - Balances
      summary: Retrieve a list of the client's balances
      description: >-
        Retrieve a list of the client's balances, optionally filtered by
        currency
      parameters:
        - description: A comma-separated list of currency codes compliant to ISO 4217
          in: query
          name: currencies
          required: true
          schema:
            type: string
        - description: The ID of the client
          in: query
          name: client_id
          required: true
          schema:
            type: string
        - description: >-
            The balance types to be retrieved. Multiple types can be specified
            by repeating the parameter (e.g.,
            balance_types=InterimAvailable&balance_types=Outgoing).
          in: query
          name: balance_types
          required: false
          style: form
          explode: true
          schema:
            type: array
            default:
              - InterimAvailable
            items:
              type: string
              enum:
                - InterimAvailable
                - RequiredFunds
                - RequiredFundsImmediate
                - Outgoing
                - Incoming
                - InitialMargin
                - MarginCall
                - Processing
        - description: Page number (1-indexed) for paginated results
          in: query
          name: page
          required: false
          schema:
            type: integer
            minimum: 1
        - description: Number of items per page (default 50, max 100)
          in: query
          name: page_size
          required: false
          schema:
            type: integer
            minimum: 1
            maximum: 100
        - description: >-
            Field to sort results by. Use 'currency' to sort alphabetically by
            currency code, or a balance type name to sort by that balance's
            amount.
          in: query
          name: sort_by
          required: false
          schema:
            type: string
            enum:
              - currency
              - InterimAvailable
              - RequiredFunds
              - RequiredFundsImmediate
              - Outgoing
              - Incoming
              - InitialMargin
              - MarginCall
              - Processing
        - description: Sort order for results
          in: query
          name: sort_order
          required: false
          schema:
            type: string
            enum:
              - asc
              - desc
        - description: Comma-separated list of currency codes to pin to the top of results
          in: query
          name: pinned_currencies
          required: false
          schema:
            type: string
        - name: Authorization
          in: header
          description: The access token
          required: true
          schema:
            type: string
        - description: The ID of the contact
          in: header
          name: X-Contact-ID
          required: false
          schema:
            type: string
      responses:
        '200':
          description: A list with the client's balances.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/BalanceData'
        '400':
          description: >-
            Formatting, parameter or schema validation error. See error message
            for further details
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '401':
          description: Access denied due to authentication failure
        '403':
          description: >-
            Could not complete action due to data constraints. Refer to error
            message for additional details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
        '404':
          description: Client ID not found
        '409':
          description: >-
            Could not update contact due to data constraint or conflict with
            contact status. Refer to error message for additional details
        '502':
          description: Internal integration error. Contact support
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorMessage'
components:
  schemas:
    BalanceData:
      properties:
        account_id:
          description: >-
            The UUID of the account. Null for aggregate balance types (Incoming,
            Outgoing, RequiredFundsImmediate, Processing) which are calculated
            across all accounts for a currency.
          type: string
          nullable: true
        amount:
          $ref: '#/components/schemas/BalanceAmount'
        credit_debit_indicator:
          $ref: '#/components/schemas/CreditDebitIndicator'
        datetime:
          description: The date and time when the balance was calculated.
          type: string
        type:
          $ref: '#/components/schemas/BalanceType'
      required:
        - account_id
        - amount
        - credit_debit_indicator
        - datetime
        - type
      type: object
    ErrorMessage:
      description: An error message.
      properties:
        code:
          type: string
          description: The code for the error.
        details:
          description: Error details
          type: string
        message:
          type: string
          description: A short description of the cause of the error.
      required:
        - code
        - message
        - details
      type: object
    BalanceAmount:
      properties:
        amount:
          description: The amount of the balance.
          type: string
        currency:
          description: The ISO 4217 code of the balance currency
          type: string
      required:
        - amount
        - currency
      type: object
    CreditDebitIndicator:
      description: Whether the balance is credit or debit
      enum:
        - Credit
        - Debit
      type: string
    BalanceType:
      description: >
        Balance type enumeration.

        RequiredFundsImmediate: items due now (same as Ebury Online).

        RequiredFunds: includes future-dated items (kept for backwards
        compatibility).
      enum:
        - InterimAvailable
        - RequiredFunds
        - RequiredFundsImmediate
        - Outgoing
        - Incoming
        - InitialMargin
        - MarginCall
        - Processing
      type: string
  securitySchemes:
    api_key:
      description: An API Key.
      in: header
      name: x-api-key
      type: apiKey

````