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

# Create or update a bank account balance

> Creates a balance for the specified bank account. If a balance already exists for the same date and balance type, it will be updated with the new amount (upsert behavior).



## OpenAPI

````yaml /openapi.json post /bank_account_balances
openapi: 3.1.0
info:
  title: End Close API
  description: REST API is used to interact with the End Close platform.
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.endclose.com/v1
security:
  - ApiKeyAuth: []
paths:
  /bank_account_balances:
    post:
      summary: Create or update a bank account balance
      description: >-
        Creates a balance for the specified bank account. If a balance already
        exists for the same date and balance type, it will be updated with the
        new amount (upsert behavior).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - bank_account_id
                - date
                - balance_type
                - amount_cents
              properties:
                bank_account_id:
                  type: string
                  description: ID of the bank account
                date:
                  type: string
                  format: date
                  description: The date of the balance
                balance_type:
                  type: string
                  enum:
                    - opening_ledger
                    - closing_ledger
                    - current_ledger
                    - opening_available
                    - opening_available_next_business_day
                    - closing_available
                    - current_available
                    - previously_closed_book
                    - other
                  description: The type of balance
                amount_cents:
                  type: integer
                  description: The balance amount in cents (e.g., 1234 = $12.34)
      responses:
        '201':
          description: Balance created or updated
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BankAccountBalance'
        '401':
          description: Unauthorized
        '422':
          description: Validation error
components:
  schemas:
    BankAccountBalance:
      type: object
      required:
        - bank_account_id
        - date
        - balance_type
        - amount_cents
      properties:
        id:
          type: integer
          description: Unique numeric identifier
        bank_account_id:
          type: integer
          description: ID of the bank account this balance belongs to
        date:
          type: string
          format: date
          description: The date of the balance
        balance_type:
          type: string
          enum:
            - opening_ledger
            - closing_ledger
            - current_ledger
            - opening_available
            - opening_available_next_business_day
            - closing_available
            - current_available
            - previously_closed_book
            - other
          description: The type of balance
        amount_cents:
          type: integer
          description: The balance amount in cents (e.g., 1234 = $12.34)
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````