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

# Get account balance by tag

> Fetch the balance of an account by its ID and optional filters.



## OpenAPI

````yaml /openAPI/openapi-20240301.json get /accounting_new/accounts/{account_id}/balance
openapi: 3.1.0
info:
  title: zenskar
  version: 2.0.0
servers:
  - url: https://api.zenskar.com
security:
  - ApiTokenAuth: []
    OrganisationAuth: []
paths:
  /accounting_new/accounts/{account_id}/balance:
    get:
      tags:
        - Accounting
      summary: Get account balance by tag
      description: Fetch the balance of an account by its ID and optional filters.
      operationId: Get-account-balance-by-tag
      parameters:
        - name: account_id
          in: path
          required: true
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Account Id
        - name: as_of
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date
              - type: 'null'
            title: As Of
        - name: id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Id
        - name: id__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Id  In
        - name: account_id__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Account Id  In
        - name: journal_entry_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Journal Entry Id
        - name: journal_entry_id__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Journal Entry Id  In
        - name: currency
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Currency
        - name: currency__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Currency  In
        - name: customer_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Customer Id
        - name: customer_id__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Customer Id  In
        - name: contract_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Contract Id
        - name: contract_id__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Contract Id  In
        - name: invoice_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Invoice Id
        - name: invoice_id__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Invoice Id  In
        - name: credit_note_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Credit Note Id
        - name: credit_note_id__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Credit Note Id  In
        - name: tax_jurisdiction_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Tax Jurisdiction Id
        - name: tax_jurisdiction_id__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Tax Jurisdiction Id  In
        - name: payment_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Payment Id
        - name: payment_id__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Payment Id  In
        - name: refund_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Refund Id
        - name: refund_id__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Refund Id  In
        - name: revenue_contract_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Revenue Contract Id
        - name: revenue_contract_id__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Revenue Contract Id  In
        - name: revenue_contract_item_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Revenue Contract Item Id
        - name: revenue_contract_item_id__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Revenue Contract Item Id  In
        - name: performance_obligation_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Performance Obligation Id
        - name: performance_obligation_id__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Performance Obligation Id  In
        - name: product_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Product Id
        - name: product_id__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Product Id  In
        - name: credits
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Credits
        - name: credits__neq
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Credits  Neq
        - name: credits__gt
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Credits  Gt
        - name: credits__gte
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Credits  Gte
        - name: credits__lt
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Credits  Lt
        - name: credits__lte
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Credits  Lte
        - name: debits
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Debits
        - name: debits__neq
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Debits  Neq
        - name: debits__gt
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Debits  Gt
        - name: debits__gte
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Debits  Gte
        - name: debits__lt
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Debits  Lt
        - name: debits__lte
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
            title: Debits  Lte
        - name: account__id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Account  Id
        - name: account__id__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Account  Id  In
        - name: account__name
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Account  Name
        - name: account__name__ilike
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Account  Name  Ilike
        - name: account__description
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Account  Description
        - name: account__account_category
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/AccountCategory'
              - type: 'null'
            title: Account  Account Category
        - name: account__account_category__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Account  Account Category  In
        - name: account__parent_path
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Account  Parent Path
        - name: account__parent_path__ilike
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Account  Parent Path  Ilike
        - name: account__balance_normality
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/BalanceNormalityNew'
              - type: 'null'
            title: Account  Balance Normality
        - name: account__balance_normality__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Account  Balance Normality  In
        - name: account__is_parent
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            title: Account  Is Parent
        - name: journal_entry__id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Journal Entry  Id
        - name: journal_entry__id__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Journal Entry  Id  In
        - name: journal_entry__posted_at
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Journal Entry  Posted At
        - name: journal_entry__posted_at__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Journal Entry  Posted At  In
        - name: journal_entry__posted_at__gt
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Journal Entry  Posted At  Gt
        - name: journal_entry__posted_at__gte
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Journal Entry  Posted At  Gte
        - name: journal_entry__posted_at__lt
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Journal Entry  Posted At  Lt
        - name: journal_entry__posted_at__lte
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: date-time
              - type: 'null'
            title: Journal Entry  Posted At  Lte
        - name: journal_entry__description
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Journal Entry  Description
        - name: journal_entry__description__ilike
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Journal Entry  Description  Ilike
        - name: journal_entry__event
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Journal Entry  Event
        - name: journal_entry__event__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Journal Entry  Event  In
        - name: journal_entry__status_type
          in: query
          required: false
          schema:
            anyOf:
              - $ref: '#/components/schemas/JournalEntryStatusType'
              - type: 'null'
            title: Journal Entry  Status Type
        - name: journal_entry__status_type__in
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Journal Entry  Status Type  In
        - name: journal_entry__job_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Journal Entry  Job Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/AccountBalanceSchema'
                title: Response Get-Account-Balance-By-Tag
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AccountCategory:
      type: string
      enum:
        - Assets
        - Liabilities
        - Equity
        - Income
        - Expenses
      title: AccountCategory
    BalanceNormalityNew:
      type: string
      enum:
        - credit
        - debit
      title: BalanceNormalityNew
    JournalEntryStatusType:
      type: string
      enum:
        - pending
        - forecasted
        - estimated
        - posted
      title: JournalEntryStatusType
    AccountBalanceSchema:
      properties:
        balance:
          type: integer
          title: Balance
          default: 0
        credits:
          type: integer
          title: Credits
          default: 0
        debits:
          type: integer
          title: Debits
          default: 0
        currency:
          type: string
          title: Currency
      type: object
      required:
        - currency
      title: AccountBalanceSchema
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiTokenAuth:
      type: apiKey
      in: header
      name: x-api-key
      x-default: <your-api-key>
    OrganisationAuth:
      type: apiKey
      in: header
      name: organisation
      x-default: <your-organisation-id>

````