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

# Set opening balance

> Sets the balance of the account at a specific time, which is necessary for showing both a current balance and a correct opening balance. This is useful when configuring the account for the first time or when accounting features are enabled starting at a time after the account was created.



## OpenAPI

````yaml post /v1/businesses/{businessId}/custom-accounts/{customAccountId}/balance
openapi: 3.0.1
info:
  title: API
  version: latest
servers: []
security:
  - BearerAuth: []
tags: []
externalDocs:
  url: /
paths:
  /v1/businesses/{businessId}/custom-accounts/{customAccountId}/balance:
    post:
      tags: []
      summary: Set opening balance
      description: >-
        Sets the balance of the account at a specific time, which is necessary
        for showing both a current balance and a correct opening balance. This
        is useful when configuring the account for the first time or when
        accounting features are enabled starting at a time after the account was
        created.
      operationId: business.custom-accounts.balance.post
      parameters:
        - name: businessId
          in: path
          description: The UUID of the business to set opening balance for.
          required: true
          schema:
            type: string
        - name: customAccountId
          in: path
          description: The UUID of the custom account to set opening balance for.
          required: true
          schema:
            type: string
        - name: Content-Type
          in: header
          description: Content-Type must be set to application/json
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewCustomAccountBalance'
      responses:
        '200':
          description: ''
          headers: {}
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmptyResponse'
        '404':
          description: >-
            Business id or custom account id is not found. This indicates the
            business id is invalid or the business has been archived, or the
            custom account id is invalid or the custom account has been deleted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      deprecated: false
components:
  schemas:
    NewCustomAccountBalance:
      type: object
      properties:
        amount:
          type: integer
          description: The new balance for the custom account, in cents.
        date:
          type: string
          format: date-time
          description: The timestamp when the new balance was recorded
    EmptyResponse:
      type: object
      properties:
        type:
          type: string
          description: >-
            Resource type. Value will be
            'com.layerfi.controllers.EmptyResponse'.
          example: '{}'
    ApiError:
      type: object
      properties: {}
      example: ''
      description: ''
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````