> ## 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.

# Create a Ledger

> **Scopes:** `ledger:create`



## OpenAPI

````yaml /api-reference/openapi.json post /v0/business/{business_id}/ledger
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:
    post:
      tags:
        - Ledger
      summary: Create a Ledger
      description: '**Scopes:** `ledger:create`'
      operationId: create_business_ledger_v0_business__business_id__ledger_post
      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
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/LedgerCreateRequest'
      responses:
        '201':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BusinessLedgerSuccess'
        '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:create
components:
  schemas:
    LedgerCreateRequest:
      properties:
        name:
          type: string
          maxLength: 255
          title: Name
          description: The name of the ledger
          examples:
            - Checking x5678
        description:
          anyOf:
            - type: string
              maxLength: 100
            - type: 'null'
          title: Description
          description: Optional description or definition of the ledger
          examples:
            - Business checking account
        type:
          $ref: '#/components/schemas/LedgerType'
          description: The ledger type
          examples:
            - asset
        subtype:
          $ref: '#/components/schemas/LedgerSubType'
          description: The ledger subtype
          examples:
            - current_asset
        financial_account_type:
          anyOf:
            - $ref: '#/components/schemas/FinancialAccountType'
            - type: 'null'
          description: Used for ledgers that are connected to real-world financial accounts
          examples:
            - bank_account
        debit_credit:
          anyOf:
            - $ref: '#/components/schemas/DebitCredit'
            - type: 'null'
          description: >-
            Indicates if the ledger is a debit or credit ledger. Auto-derived
            from subtype if not provided.
        sort_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Sort Code
          description: Used for grouping and sorting ledgers in reports
          examples:
            - '1010'
        report_cash_flow:
          type: boolean
          title: Report Cash Flow
          description: Whether the ledger is included in the cash flow report
        parent_id:
          anyOf:
            - type: string
              format: ldg_string
            - type: 'null'
          title: Parent Id
          description: >-
            It indicates if this is a child ledger of another ledger in the
            chart of accounts.
        tax_category:
          anyOf:
            - $ref: '#/components/schemas/TaxCategory'
            - type: 'null'
          description: Tax category used for tax estimate calculations
          examples:
            - office_expenses
      type: object
      required:
        - name
        - type
        - subtype
        - report_cash_flow
      title: LedgerCreateRequest
    BusinessLedgerSuccess:
      properties:
        data:
          $ref: '#/components/schemas/LedgerPublic'
      type: object
      required:
        - data
      title: BusinessLedgerSuccess
    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
    LedgerType:
      type: string
      enum:
        - asset
        - liability
        - equity
        - revenue
        - expense
      title: LedgerType
    LedgerSubType:
      type: string
      enum:
        - current_asset
        - fixed_asset
        - other_asset
        - uncategorized_asset
        - current_liability
        - long_term_liability
        - operating_revenue
        - other_inflow
        - cost_of_goods_sold
        - operating_expense
        - other_outflow
        - contribution
        - distribution
        - common_stock
        - preferred_stock
        - additional_capital
        - opening_balance
        - retained_earnings
        - memo
      title: LedgerSubType
    FinancialAccountType:
      type: string
      enum:
        - bank_account
        - credit_card
        - prepaid_card
        - payments
        - payroll
        - loan
        - accounts_receivable
        - accounts_payable
      title: FinancialAccountType
    DebitCredit:
      type: string
      enum:
        - debit
        - credit
      title: DebitCredit
    TaxCategory:
      type: string
      enum:
        - revenue
        - returns_discounts
        - other_income
        - cost_of_goods_sold
        - advertising
        - vehicle
        - commissions_fees
        - contract_labor
        - depreciation
        - employee_benefits
        - insurance
        - interest
        - legal_professional
        - office_expenses
        - equipment_rental
        - building_rent
        - repairs_maintenance
        - supplies
        - taxes_licenses
        - travel
        - meals
        - utilities
        - wages
        - other_business_expenses
        - home_office
        - self_employed_health_insurance
        - hsa_contributions
      title: TaxCategory
    LedgerPublic:
      properties:
        name:
          type: string
          maxLength: 255
          title: Name
          description: The name of the ledger
          examples:
            - Checking x5678
        description:
          anyOf:
            - type: string
              maxLength: 100
            - type: 'null'
          title: Description
          description: Optional description or definition of the ledger
          examples:
            - Business checking account
        type:
          $ref: '#/components/schemas/LedgerType'
          description: The ledger type
          examples:
            - asset
        subtype:
          $ref: '#/components/schemas/LedgerSubType'
          description: The ledger subtype
          examples:
            - current_asset
        financial_account_type:
          anyOf:
            - $ref: '#/components/schemas/FinancialAccountType'
            - type: 'null'
          description: Used for ledgers that are connected to real-world financial accounts
          examples:
            - bank_account
        debit_credit:
          $ref: '#/components/schemas/DebitCredit'
          description: Indicates if the ledger is a debit or credit ledger
          examples:
            - debit
        sort_code:
          anyOf:
            - type: string
            - type: 'null'
          title: Sort Code
          description: Used for grouping and sorting ledgers in reports
          examples:
            - '1010'
        report_cash_flow:
          type: boolean
          title: Report Cash Flow
          description: Whether the ledger is included in the cash flow report
        parent_id:
          anyOf:
            - type: string
              format: ldg_string
            - type: 'null'
          title: Parent Id
          description: >-
            It indicates if this is a child ledger of another ledger in the
            chart of accounts.
          examples:
            - ldg_KtY7p9fsM4pB58SYNar7cv
        tax_category:
          anyOf:
            - $ref: '#/components/schemas/TaxCategory'
            - type: 'null'
          description: Tax category used for tax estimate calculations
          examples:
            - office_expenses
        id:
          type: string
          format: ldg_string
          title: Id
          description: The ID of the Ledger
          examples:
            - ldg_WQMDNUHpBThYSNh4AprDBo
        business_id:
          type: string
          format: biz_string
          title: Business Id
          description: The ID of the Business that is associated with the Ledger
          examples:
            - biz_Pk2fNFDd8wj7EFeLWJywc7
      type: object
      required:
        - name
        - type
        - subtype
        - debit_credit
        - report_cash_flow
        - id
        - business_id
      title: LedgerPublic
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: /v0/auth/token

````