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

# Set the Opening Balance for a Ledger

> **Scopes:** `ledger:update`



## OpenAPI

````yaml /api-reference/openapi.json put /v0/business/{business_id}/ledger/{ledger_id}/opening-balance
openapi: 3.1.0
info:
  title: Asset API
  version: '0.1'
servers:
  - url: https://api.sandbox.getasset.com
    description: Sandbox
  - url: https://api.getasset.com
    description: Production
security: []
paths:
  /v0/business/{business_id}/ledger/{ledger_id}/opening-balance:
    put:
      tags:
        - Ledger
      summary: Set the Opening Balance for a Ledger
      description: '**Scopes:** `ledger:update`'
      operationId: >-
        set_ledger_opening_balance_v0_business__business_id__ledger__ledger_id__opening_balance_put
      parameters:
        - name: business_id
          in: path
          required: true
          schema:
            description: The id of the business
            examples:
              - biz_GA6EG2qFxA97NZHtxeLPUy
            type: string
            format: biz_string
            title: Business Id
          description: The id of the business
        - name: ledger_id
          in: path
          required: true
          schema:
            description: The id of the ledger
            examples:
              - ldg_WQMDNUHpBThYSNh4AprDBo
            type: string
            format: ldg_string
            title: Ledger Id
          description: The id of the ledger
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LedgerOpeningBalanceRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LedgerOpeningBalanceSuccess'
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Forbidden
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Content
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Service Unavailable
      security:
        - OAuth2PasswordBearer:
            - ledger:update
components:
  schemas:
    LedgerOpeningBalanceRequest:
      properties:
        amount:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
          description: >-
            The opening balance for this ledger as of the business entries start
            date. Positive values represent the normal balance side of the
            ledger, negative values represent the opposite side.
          examples:
            - '1000.00'
      type: object
      required:
        - amount
      title: LedgerOpeningBalanceRequest
    LedgerOpeningBalanceSuccess:
      properties:
        data:
          $ref: '#/components/schemas/LedgerOpeningBalancePublic'
      type: object
      required:
        - data
      title: LedgerOpeningBalanceSuccess
    ErrorResponse:
      properties:
        error:
          anyOf:
            - type: string
            - type: 'null'
          title: Error
          description: A description of the error
        data:
          title: Data
          description: Data associated with the error
      type: object
      required:
        - error
        - data
      title: ErrorResponse
    LedgerOpeningBalancePublic:
      properties:
        ledger_id:
          type: string
          format: ldg_string
          title: Ledger Id
          description: The ID of the Ledger
          examples:
            - ldg_WQMDNUHpBThYSNh4AprDBo
        amount:
          type: number
          title: Amount
          description: The opening balance amount for this ledger
          examples:
            - 1000
      type: object
      required:
        - ledger_id
        - amount
      title: LedgerOpeningBalancePublic
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /v0/auth/token

````