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

# Get the balance for a company

> Fetches the current balance of all accounts for a company.



## OpenAPI

````yaml get /v1/companies/{companyId}/balance
openapi: 3.0.1
info:
  title: E Money Records Hub API
  description: E Money Records Hub OpenAPI definitions
  termsOfService: https://pleo.io/terms/
  contact:
    email: api@pleo.io
  license:
    name: Apache 2.0
    url: http://www.apache.org/licenses/LICENSE-2.0.html
  version: 6.4.0
servers:
  - url: https://external.pleo.io
    description: Production server
  - url: https://external.staging.pleo.io
    description: Staging server
security:
  - bearerAuth: []
  - basicAuth: []
tags:
  - name: EMoneyRecordsHub
    description: This resource is associated with the EMoneyRecordsHub API
  - name: Company
    description: External Company API
paths:
  /v1/companies/{companyId}/balance:
    get:
      tags:
        - Company
      summary: Get the balance for a company
      description: Fetches the current balance of all accounts for a company.
      operationId: getExternalBalance
      parameters:
        - name: companyId
          in: path
          description: Identifier of the company for which the balance is being fetched
          required: true
          style: simple
          explode: false
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: Current balance for all accounts of the company
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/ExternalCompanyBalanceResponse'
        '404':
          description: Company not found
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/ExternalErrorResponse'
        '410':
          description: Company accounts are closed
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/ExternalErrorResponse'
        '502':
          description: The balance could not be retrieved from an upstream dependency
          content:
            application/json;charset=UTF-8:
              schema:
                $ref: '#/components/schemas/ExternalErrorResponse'
components:
  schemas:
    ExternalCompanyBalanceResponse:
      required:
        - data
      type: object
      properties:
        data:
          $ref: '#/components/schemas/ExternalCompanyBalance'
    ExternalErrorResponse:
      required:
        - error
      type: object
      properties:
        error:
          $ref: '#/components/schemas/ExternalErrorInfo'
    ExternalCompanyBalance:
      required:
        - accounts
        - companyId
      type: object
      properties:
        accounts:
          type: array
          description: List of account balances for the company
          items:
            $ref: '#/components/schemas/ExternalAccountBalance'
        companyId:
          type: string
          description: Identifier of the company
          format: uuid
      description: Company balance data
    ExternalErrorInfo:
      required:
        - message
        - type
      type: object
      properties:
        message:
          type: string
          description: Human-readable description of the error
        type:
          type: string
          description: Machine-readable error code identifying the type of error
      description: Error details
    ExternalAccountBalance:
      required:
        - balance
        - id
        - isPrimary
      type: object
      properties:
        balance:
          $ref: '#/components/schemas/ExternalBalance'
        id:
          type: string
          description: Unique identifier of the account
          format: uuid
        isPrimary:
          type: boolean
          description: Whether the account is the primary/default account for the company
      description: List of account balances for the company
    ExternalBalance:
      required:
        - available
        - current
        - overdraftLimit
        - pendingDebits
        - usedOverdraft
      type: object
      properties:
        available:
          $ref: '#/components/schemas/Money'
        current:
          $ref: '#/components/schemas/Money'
        overdraftLimit:
          $ref: '#/components/schemas/Money'
        pendingDebits:
          $ref: '#/components/schemas/Money'
        usedOverdraft:
          $ref: '#/components/schemas/Money'
      description: Balance of the account
    Money:
      required:
        - currency
        - value
      type: object
      properties:
        currency:
          type: string
          description: ISO 4217 currency code. See CurrencyCode for known values.
          example: EUR
        value:
          type: integer
          description: Value in minor units of the currency
          format: int64
          example: 50000
      description: >-
        A monetary value expressed as an ISO 4217 currency and an integer value
        in minor units of that currency
  securitySchemes:
    bearerAuth:
      type: http
      description: >-
        JWT Bearer token authentication. Include the token in the Authorization
        header as: `Bearer <token>`
      scheme: bearer
      bearerFormat: JWT
    basicAuth:
      type: http
      description: >-
        Basic HTTP authentication using API key. Use your API key as the
        username and leave the password empty. The credentials will be Base64
        encoded automatically.
      scheme: basic

````