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

# List ledger entries

> Returns ledger entries (journal entries) for the business. Supports filtering by date range, reporting basis, customer, vendor, and tags. Results are paginated.



## OpenAPI

````yaml get /v1/businesses/{businessId}/ledger/entries
openapi: 3.0.1
info:
  title: API
  version: latest
servers: []
security:
  - BearerAuth: []
tags: []
externalDocs:
  url: /
paths:
  /v1/businesses/{businessId}/ledger/entries:
    get:
      tags: []
      summary: List ledger entries
      description: >-
        Returns ledger entries (journal entries) for the business. Supports
        filtering by date range, reporting basis, customer, vendor, and tags.
        Results are paginated.
      operationId: business.ledger.entries.get
      parameters:
        - name: businessId
          in: path
          description: The UUID of the business
          required: true
          schema:
            type: string
        - name: start_date
          in: query
          description: Start date for entries (inclusive)
          required: false
          schema:
            type: string
            format: date-time
        - name: end_date
          in: query
          description: End date for entries (exclusive)
          required: false
          schema:
            type: string
            format: date-time
        - name: reporting_basis
          in: query
          description: Reporting basis for the entries (ACCRUAL or CASH)
          required: false
          schema:
            type: string
            enum:
              - ACCRUAL
              - CASH
            default: ACCRUAL
        - name: customer_id
          in: query
          description: Filter entries by customer UUID
          required: false
          schema:
            type: string
            format: uuid
        - name: customer_external_id
          in: query
          description: Filter entries by customer external ID
          required: false
          schema:
            type: string
        - name: vendor_id
          in: query
          description: Filter entries by vendor UUID
          required: false
          schema:
            type: string
            format: uuid
        - name: vendor_external_id
          in: query
          description: Filter entries by vendor external ID
          required: false
          schema:
            type: string
        - name: include_entries_before_activation
          in: query
          description: Include entries before business activation date
          required: false
          schema:
            type: boolean
            default: false
        - name: Content-Type
          in: header
          description: Content-Type must be set to application/json
          schema:
            type: string
      responses:
        '200':
          description: List of ledger entries
          headers: {}
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ApiLedgerEntryWithTransaction'
        '404':
          description: Business not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
      deprecated: false
components:
  schemas:
    ApiLedgerEntryWithTransaction:
      type: object
      properties:
        id:
          type: string
          description: Unique identifier of the ledger entry
        business_id:
          type: string
          format: uuid
        ledger_id:
          type: string
        agent:
          $ref: '#/components/schemas/ClassifierAgent'
        entry_type:
          $ref: '#/components/schemas/LedgerEntryType'
        date:
          type: string
          format: date-time
        entry_at:
          type: string
          format: date-time
        reversal_of_id:
          type: string
          nullable: true
        reversal_id:
          type: string
          nullable: true
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/ApiLineItem'
        transaction:
          $ref: '#/components/schemas/ApiBankTransaction'
        invoice:
          $ref: '#/components/schemas/ApiInvoice'
        manual_entry:
          $ref: '#/components/schemas/ApiManualLedgerEntry'
        source:
          $ref: '#/components/schemas/LedgerEntrySource'
    ApiError:
      type: object
      properties: {}
      example: ''
      description: ''
    ClassifierAgent:
      type: string
      enum:
        - SMS
        - API
        - LAYER_AUTO
        - LAYER_MANUAL
    LedgerEntryType:
      type: string
      enum:
        - BANK
        - MANUAL
        - OPENING_BALANCE
    ApiLineItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier of the ledger account line item.
        entry_id:
          type: string
          format: uuid
          description: ID of the Journal entry the ledger account line item was part of.
        account:
          $ref: '#/components/schemas/SingleApiChartAccount'
          description: Simplified Ledger Account object containing this line item.
        amount:
          type: integer
          format: int64
          description: Amount of the financial transaction associated with the line item
        direction:
          $ref: '#/components/schemas/BankTransactionDirection'
          description: Direction of line item.
        entry_at:
          type: string
          format: date-time
          description: >-
            Timestamp of the financial transaction associated with the line
            item.
        createdAt:
          type: string
          format: date-time
          description: Timestamp when ledger entry was added to the ledger account.
    ApiBankTransaction:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier of the bank transaction
        business_id:
          type: string
          format: uuid
          description: >-
            Unique identifier of the business the bank transaction is associated
            with
        source:
          $ref: '#/components/schemas/TransactionSource'
          description: Source of the transaction.
        source_transaction_id:
          type: string
          description: >-
            External transaction ID from the source platform (e.g, Plaid
            transaction ID)
          example: g4DlKyjXqGH3Kp5XlaWMtwLRrE4Z9AiE8B4Ko
        source_account_id:
          type: string
          description: External account ID from the source platform (e.g, Plaid account ID)
          example: Aaoy8G7VXZHVeqNoL1GvcmkPdqpLRWi9NArdG
        imported_at:
          type: string
          format: date-time
          description: Timestamp when the transaction was imported
        date:
          type: string
          format: date-time
          description: Date of the transaction
        direction:
          $ref: '#/components/schemas/BankTransactionDirection'
          description: Direction of the transaction.
        amount:
          type: integer
          format: int64
          description: Transaction amount in cents
        counterparty_name:
          type: string
          nullable: true
          description: Name of the transaction counterparty
          example: WeWork
        description:
          type: string
          nullable: true
          description: Description of the transaction.
          example: WeWork monthly rent payment
        account_name:
          type: string
          nullable: true
          description: Name of the bank account
          example: Plaid Checking
        categorizationStatus:
          $ref: '#/components/schemas/CategorizationStatus'
          description: The status of the transaction’s categorization in Layer’s systems.
        category:
          $ref: '#/components/schemas/ApiCategorization'
          description: >-
            The category assigned to the transaction. Only populated for
            transactions that have a finalized category.
        categorization_method:
          $ref: '#/components/schemas/ClassifierAgent'
          description: The method used to classify the transaction.
        projected_income_category:
          $ref: '#/components/schemas/ProjectedIncomeCategory'
        suggested_matches:
          type: array
          items:
            $ref: '#/components/schemas/ApiSuggestedMatch'
        match:
          $ref: '#/components/schemas/ApiMatch'
        transaction_tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiTag'
        memo:
          type: string
          nullable: true
          description: >-
            Memo for any text you would like to associate with the bank
            transaction (for example, to display to end users).
        metadata:
          $ref: '#/components/schemas/PlatformDefinedJson'
          nullable: true
          description: Arbitrary custom metadata in JSON format with a size limit of 1KB
        reference_number:
          type: string
          nullable: true
          description: >-
            Any (typically user-visible) identifier you would like to associate
            with the bank transaction. Can be used to filter when listing bank
            transactions.
    ApiInvoice:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the invoice.
        type:
          type: string
          description: Resource type. Value will be 'Invoice'.
          example: Invoice
        business_id:
          type: string
          format: uuid
          description: ID of the Business that generated the invoice.
        external_id:
          type: string
          description: Unique ID of the invoice in your system for linking purposes.
          example: '1'
        status:
          $ref: '#/components/schemas/InvoiceStatus'
          description: Status of the invoice.
        sent_at:
          type: string
          format: date-time
          description: When the invoice was sent by the business to the recipient.
        due_at:
          type: string
          format: date-time
          description: When the invoice is due.
        paid_at:
          type: string
          format: date-time
          description: When the invoice was paid.
        voided_at:
          type: string
          format: date-time
          description: >-
            When the invoice was voided. Voiding excludes the invoice from
            accounting.
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/ApiInvoiceLineItem'
          description: Line items making up the invoice
        subtotal:
          type: integer
          description: Subtotal of all invoice line items in cents.
        additional_discount:
          type: integer
          description: >-
            Additional discount applied to the whole invoice in addition to
            individual line items.
        additional_sales_taxes_total:
          type: integer
          description: >-
            Sum of all taxes across the invoice line items and any additional
            taxes in cents.
        additional_sales_taxes:
          type: array
          items:
            $ref: '#/components/schemas/ApiInvoiceTaxLineItem'
          description: List of additional sales tax line items
        tips:
          type: integer
          description: Tips included by the buyer, in cents.
        total_amount:
          type: integer
          description: Total amount of the invoice in cents.
        outstanding_balance:
          type: integer
          description: >-
            The remaining balance on the invoice after factoring in all previous
            invoice payments and write-offs.
        memo:
          type: string
          description: >-
            Memo for any text you would like to associate with the Invoice (for
            example, to display to end users).
        payment_allocations:
          type: array
          items:
            $ref: '#/components/schemas/ApiInvoicePaymentAllocation'
          description: >-
            Payments made by a customer are allocated toward one or many
            invoices. This list shows which payments have been been allocated
            towards this invoice. The most common case is that there is a 1:1
            relationship between a payment and an invoice, in which case the
            allocation’s `amount` will match the payment’s `amount`.
          example: []
        refund_allocations:
          type: array
          items:
            $ref: '#/components/schemas/ApiRefundAllocation'
          description: >-
            Refunds made by a customer are allocated toward one or many
            invoices. This list shows which refunds have been been allocated
            towards this invoice.
          example: []
        imported_at:
          type: string
          format: date-time
          description: >-
            Time when the invoice was first imported into Layer. **Eligible sort
            key**.
        updated_at:
          type: string
          format: date-time
          description: >-
            Time when the invoice was first updated in Layer. **Eligible sort
            key**.
        transaction_tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiTag'
          description: Tags on the transactions associated with the invoice
        metadata:
          $ref: '#/components/schemas/PlatformDefinedJson'
          nullable: true
          description: Arbitrary custom metadata in JSON format with a size limit of 1KB
        reference_number:
          type: string
          nullable: true
          description: >-
            Any (typically user-visible) identifier you would like to associate
            with the invoice. Can be used to filter when listing invoices.
    ApiManualLedgerEntry:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Universally unique identifier of the manual ledger entry
        created_by:
          type: string
          description: Name of the user who created the manual ledger entry
        memo:
          type: string
          description: Memo or description for the manual ledger entry
        entry_id:
          type: string
          description: ID of the associated ledger entry
        customer:
          $ref: '#/components/schemas/ApiCustomerData'
        vendor:
          $ref: '#/components/schemas/ApiVendorData'
        transaction_tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiTag'
    LedgerEntrySource:
      type: object
      oneOf:
        - $ref: '#/components/schemas/TransactionLedgerEntrySource'
        - $ref: '#/components/schemas/InvoiceLedgerEntrySource'
        - $ref: '#/components/schemas/ManualLedgerEntrySource'
        - $ref: '#/components/schemas/InvoicePaymentLedgerEntrySource'
        - $ref: '#/components/schemas/BillLedgerEntrySource'
        - $ref: '#/components/schemas/BillPaymentLedgerEntrySource'
        - $ref: '#/components/schemas/RefundPaymentLedgerEntrySource'
        - $ref: '#/components/schemas/OpeningBalanceLedgerEntrySource'
        - $ref: '#/components/schemas/PayoutLedgerEntrySource'
      discriminator:
        propertyName: type
        mapping:
          Transaction_Ledger_Entry_Source: '#/components/schemas/TransactionLedgerEntrySource'
          Invoice_Ledger_Entry_Source: '#/components/schemas/InvoiceLedgerEntrySource'
          Bill_Ledger_Entry_Source: '#/components/schemas/BillLedgerEntrySource'
          Manual_Ledger_Entry_Source: '#/components/schemas/ManualLedgerEntrySource'
          Bill_Payment_Ledger_Entry_Source: '#/components/schemas/BillPaymentLedgerEntrySource'
          Invoice_Payment_Ledger_Entry_Source: '#/components/schemas/InvoicePaymentLedgerEntrySource'
          Refund_Ledger_Entry_Source: '#/components/schemas/RefundPaymentLedgerEntrySource'
          Opening_Balance_Ledger_Entry_Source: '#/components/schemas/OpeningBalanceLedgerEntrySource'
          Payout_Ledger_Entry_Source: '#/components/schemas/PayoutLedgerEntrySource'
    SingleApiChartAccount:
      type: object
      properties:
        id:
          $ref: '#/components/schemas/AccountIdentifier'
        name:
          type: string
          description: Name of the account
          example: Current Assets
        account_number:
          type: string
          nullable: true
          description: Account number if configured
          example: '4000'
        stable_name:
          $ref: '#/components/schemas/AccountStableName'
        normality:
          $ref: '#/components/schemas/BankTransactionDirection'
        account_type:
          $ref: '#/components/schemas/ApiLedgerAccountType'
        account_subtype:
          $ref: '#/components/schemas/ApiLedgerAccountSubtype'
      description: A single ledger account without nested children
    BankTransactionDirection:
      type: string
      enum:
        - CREDIT
        - DEBIT
    TransactionSource:
      type: string
      enum:
        - UNIT
        - PLAID
        - API
        - STRIPE
        - CUSTOM
    CategorizationStatus:
      type: string
      enum:
        - PENDING
        - READY_FOR_INPUT
        - CATEGORIZED
        - SPLIT
        - LAYER_REVIEW
        - JOURNALING
        - MATCHED
    ApiCategorization:
      description: Base schema for categorization of API entities.
      oneOf:
        - $ref: '#/components/schemas/AccountCategorization'
          title: Account
        - $ref: '#/components/schemas/ExclusionCategorization'
          title: Exclusion
        - $ref: '#/components/schemas/SplitCategorization'
          title: Split
        - $ref: '#/components/schemas/NestedApiCategorization'
      discriminator:
        propertyName: type
        mapping:
          Account: '#/components/schemas/AccountCategorization'
          Exclusion: '#/components/schemas/ExclusionCategorization'
          Split_Categorization: '#/components/schemas/SplitCategorization'
          AccountNested: '#/components/schemas/NestedAccountCategorization'
          OptionalAccountNested: '#/components/schemas/NestedOptionalCatetoryCategorization'
          ExclusionNested: '#/components/schemas/NestedExclusionCategorization'
    ProjectedIncomeCategory:
      type: string
      enum:
        - REVENUE
        - EXPENSE
        - EXCLUDE
    ApiSuggestedMatch:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Layer's identifier for the suggested match
        matchType:
          $ref: '#/components/schemas/MatchType'
          description: 'Type of the matched object. '
        details:
          $ref: '#/components/schemas/ApiMatchDetails'
          description: Details of the suggested match
    ApiMatch:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Layer's UUID for the match
        match_type:
          $ref: '#/components/schemas/MatchType'
          description: Type of the object to match
        bank_transaction:
          $ref: '#/components/schemas/ApiBankTransactionInterface'
        details:
          $ref: '#/components/schemas/ApiMatchDetails'
    ApiTag:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: ID for the tag
        key:
          type: string
          description: Key for the tag
          example: ExampleTagKey
        dimension_display_name:
          type: string
          nullable: true
          description: Display name for the tag dimension
        value:
          type: string
          description: Value for the tag
          example: ExampleTagValue
        value_display_name:
          type: string
          nullable: true
          description: Display name for the tag value definition
        dimension_id:
          type: string
          format: uuid
          description: ID of the tag dimension this tag belongs to
        definition_id:
          type: string
          format: uuid
          description: ID of the tag value definition
        archived_at:
          type: string
          format: date-time
          nullable: true
          description: When the tag was archived
      required:
        - id
        - key
        - value
        - dimension_id
        - definition_id
    PlatformDefinedJson:
      type: object
      description: Arbitrary JSON data defined by the caller, with a 1KB size constraint
      additionalProperties: true
      example:
        custom_field: value
        any valid json: below 1kb
        nested:
          meaning of life: 42
          array: []
    InvoiceStatus:
      type: string
      enum:
        - SENT
        - PARTIALLY_PAID
        - PAID
        - VOIDED
        - PARTIALLY_WRITTEN_OFF
        - WRITTEN_OFF
        - REFUNDED
    ApiInvoiceLineItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: ID of the invoice line item.
        external_id:
          type: string
          nullable: true
          description: The external ID of the invoice line item in your system.
        invoice_id:
          type: string
          format: uuid
          description: ID of the parent invoice
        account_identifier:
          $ref: '#/components/schemas/AccountIdentifier'
          description: Identifier for the account
        ledger_account:
          $ref: '#/components/schemas/SingleApiChartAccount'
          description: Ledger account for the line item
        prepayment_account:
          $ref: '#/components/schemas/SingleApiChartAccount'
          description: >-
            Ledger account for the line item used for accrual reporting. Should
            only be specified when this line item is a pre-payment.
        description:
          type: string
          nullable: true
          description: Description for the invoice line item
          example: Widget sale
        product:
          type: string
          description: Name of the product the invoice line item is for
          example: Widget
        unit_price:
          $ref: '#/components/schemas/SignedAmount'
          description: The amount in cents of each unit.
        quantity:
          type: number
          format: bigdecimal
          description: Number of units sold.
        subtotal:
          type: integer
          format: int64
          description: Subtotal for the invoice line item in cents.
        discount_amount:
          type: integer
          format: int64
          description: Total discount given to this line item, in cents.
        sales_taxes_total:
          type: integer
          format: int64
          description: Sum of amounts for all sales taxes for the line item
        sales_taxes:
          type: array
          items:
            $ref: '#/components/schemas/ApiInvoiceTaxLineItem'
          description: 'List of sales taxes line items '
          nullable: true
        total_amount:
          type: integer
          format: int64
          description: Total amount on the line item
        refund_allocations:
          type: array
          items:
            $ref: '#/components/schemas/ApiRefundAllocation'
          description: Refund allocations associated with this invoice line item
          example: []
        transaction_tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiTag'
          description: >-
            List of tags on the transaction associated with the invoice line
            item.
    ApiInvoiceTaxLineItem:
      type: object
      properties:
        tax_account:
          $ref: '#/components/schemas/TaxAccountIdentifier'
          description: >-
            Tax account name or identifier. If not set, account defaults to top
            level sales tax payable liability account.
        tax_ledger_account:
          $ref: '#/components/schemas/SingleApiChartAccount'
          description: Ledger account for the tax line item
          example:
            id: c4007474-f604-4d57-9690-b7f40f7a1cee
            name: 'Sales tax: CALIFORNIA'
            stable_name: SALES_TAXES_PAYABLE:CALIFORNIA
            normality: CREDIT
            account_type:
              value: LIABILITY
              display_name: Liabilities
            account_subtype:
              value: SALES_TAXES_PAYABLE
              display_name: Sales Taxes Payable
        amount:
          type: integer
          format: int64
          description: Amount, in cents, of tax owed.
    ApiInvoicePaymentAllocation:
      type: object
      properties:
        invoice_id:
          type: string
          format: uuid
          description: ID of the invoice.
        payment_id:
          type: string
          format: uuid
          description: ID of the payment.
        amount:
          type: integer
          format: int64
          description: >-
            Amount of the payment allocated towards this invoice. If this amount
            is the full payment amount, this payment was fully allocated towards
            this invoice. The amount cannot exceed the invoice total.
        transaction_tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiTag'
          description: >-
            List of tags on the transaction associated with the payment
            allocation
        memo:
          type: string
          nullable: true
          description: >-
            Memo for any text you would like to associate with the invoice
            payment allocation (for example, to display to end users).
        metadata:
          $ref: '#/components/schemas/PlatformDefinedJson'
          nullable: true
          description: Arbitrary custom metadata in JSON format with a size limit of 1KB
        reference_number:
          type: string
          nullable: true
          description: >-
            Any (typically user-visible) identifier you would like to associate
            with the invoice payment allocation.
    ApiRefundAllocation:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the refund allocation.
        invoice_id:
          type: string
          format: uuid
          nullable: true
          description: ID of the invoice this allocation is associated with.
        amount:
          type: integer
          format: int64
          description: Amount of the allocation in cents.
        account_identifier:
          $ref: '#/components/schemas/AccountIdentifier'
          description: >-
            Identifier of the ledger account for the refund allocation to apply
            to
          nullable: true
        invoice_external_id:
          type: string
          nullable: true
          description: External ID of the invoice this allocation is associated with.
        invoice_line_item_id:
          type: string
          format: uuid
          nullable: true
          description: >-
            ID of the invoice line item this allocation is associated with. If
            specified, must not refer to a different invoice `invoice_external`
            or `invoice_id`.
        invoice_line_item_external_id:
          type: string
          nullable: true
          description: >-
            The external ID of the invoice line item to refund. If specified
            alongside `invoice_line_item_id`, they must refer to the same
            invoice line item.
        invoice_payment_id:
          type: string
          format: uuid
          nullable: true
          description: ID of the invoice payment this allocation is associated with.
        invoice_payment_external_id:
          type: string
          nullable: true
          description: >-
            External ID of the invoice payment this allocation is associated
            with.
        customer:
          $ref: '#/components/schemas/ApiCustomerData'
        transaction_tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiTag'
        memo:
          type: string
          nullable: true
          description: >-
            Memo for any text you would like to associate with the refund
            allocation (for example, to display to end users).
        metadata:
          $ref: '#/components/schemas/PlatformDefinedJson'
          nullable: true
          description: Arbitrary custom metadata in JSON format with a size limit of 1KB
        reference_number:
          type: string
          nullable: true
          description: >-
            Any (typically user-visible) identifier you would like to associate
            with the refund allocation.
    ApiCustomerData:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the customer.
        external_id:
          type: string
          description: >-
            Unique ID of the customer in your system for linking purposes.
            **Idempotency key**.
          example: '31415926535'
        individual_name:
          type: string
          nullable: true
          description: >-
            Full name of the individual customer or contact at a corporate
            customer.
        company_name:
          type: string
          nullable: true
          description: Name of the company customer.
        email:
          type: string
          nullable: true
          description: Email address of the customer.
        mobile_phone:
          type: string
          nullable: true
          description: Mobile phone number of the customer.
        office_phone:
          type: string
          nullable: true
          description: Office phone number of the customer.
        address_string:
          type: string
          nullable: true
          description: Address of the customer.
        memo:
          type: string
          nullable: true
          description: >-
            Memo for any text you would like to associate with the customer (for
            example, to display to end users).
        status:
          type: string
          description: 'Status of the customer. Possible values: `ACTIVE`, `ARCHIVED`.'
          example: ACTIVE
        transaction_tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiTag'
    ApiVendorData:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the vendor.
        external_id:
          type: string
          description: >-
            Unique ID of the vendor in your system for linking purposes.
            **Idempotency key**.
        individual_name:
          type: string
          nullable: true
          description: Full name of the individual vendor or contact at a corporate vendor.
        company_name:
          type: string
          nullable: true
          description: Name of the company vendor.
        email:
          type: string
          nullable: true
          description: Email address of the vendor.
        mobile_phone:
          type: string
          nullable: true
          description: Mobile phone number of the vendor.
        office_phone:
          type: string
          nullable: true
          description: Office phone number of the vendor.
        address_string:
          type: string
          nullable: true
          description: Address of the vendor.
        memo:
          type: string
          nullable: true
          description: >-
            Memo for any text you would like to associate with the vendor (for
            example, to display to end users).
        status:
          type: string
          enum:
            - ACTIVE
            - ARCHIVED
          description: Status of the vendor.
        transaction_tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiTag'
    TransactionLedgerEntrySource:
      type: object
      properties:
        transaction_id:
          type: string
          format: uuid
        external_id:
          type: string
        account_name:
          type: string
        date:
          type: string
          format: date-time
        amount:
          type: integer
          format: int64
        direction:
          $ref: '#/components/schemas/BankTransactionDirection'
        counterparty:
          type: string
          nullable: true
        entity_name:
          type: string
          default: Bank Transaction
        display_description:
          type: string
          default: Generated display description based on account name and date
    InvoiceLedgerEntrySource:
      type: object
      properties:
        invoice_id:
          type: string
          format: uuid
        external_id:
          type: string
          nullable: true
        invoice_number:
          type: string
          nullable: true
        recipient_name:
          type: string
        date:
          type: string
          format: date-time
        amount:
          type: integer
          format: int64
        entity_name:
          type: string
          default: Invoice
        display_description:
          type: string
          default: Generated display description based on invoice number and date
    ManualLedgerEntrySource:
      type: object
      properties:
        manual_entry_id:
          type: string
          format: uuid
        memo:
          type: string
        created_by:
          type: string
        entity_name:
          type: string
          default: Manual Entry
        display_description:
          type: string
          default: Manual Entry
    InvoicePaymentLedgerEntrySource:
      type: object
      properties:
        external_id:
          type: string
          nullable: true
        invoice_id:
          type: string
          format: uuid
        invoice_number:
          type: string
          nullable: true
        amount:
          type: integer
          format: int64
        entity_name:
          type: string
          default: Invoice Payment
        display_description:
          type: string
          default: Payment on invoice based on invoice number
    BillLedgerEntrySource:
      type: object
      properties:
        bill_id:
          type: string
          format: uuid
        external_id:
          type: string
          nullable: true
        bill_number:
          type: string
          nullable: true
        vendor_name:
          type: string
        date:
          type: string
          format: date-time
        amount:
          type: integer
          format: int64
        entity_name:
          type: string
          default: Bill
        display_description:
          type: string
          default: Generated display description based on bill number and date
    BillPaymentLedgerEntrySource:
      type: object
      properties:
        external_id:
          type: string
          nullable: true
        bill_id:
          type: string
          format: uuid
        bill_number:
          type: string
          nullable: true
        amount:
          type: integer
          format: int64
        entity_name:
          type: string
          default: Bill Payment
        display_description:
          type: string
          default: Payment on bill based on bill number
    RefundPaymentLedgerEntrySource:
      type: object
      properties:
        external_id:
          type: string
          nullable: true
        refund_id:
          type: string
          format: uuid
        refunded_to_customer_amount:
          type: integer
          format: int64
        recipient_name:
          type: string
        entity_name:
          type: string
          default: Refund
        display_description:
          type: string
          default: Refund of amount based on customer details
    OpeningBalanceLedgerEntrySource:
      type: object
      properties:
        account_name:
          type: string
        entity_name:
          type: string
          default: Opening Balance Entry
        display_description:
          type: string
          default: Opening balance for specified account
    PayoutLedgerEntrySource:
      type: object
      properties:
        payout_id:
          type: string
          format: uuid
        external_id:
          type: string
          nullable: true
        paid_out_amount:
          type: integer
          format: int64
        processor:
          type: string
        completed_at:
          type: string
          format: date-time
        entity_name:
          type: string
          default: Payout
        display_description:
          type: string
          default: Payout processed by specified processor on specified date
    AccountIdentifier:
      oneOf:
        - $ref: '#/components/schemas/AccountId'
          description: ID of the account
          title: Account ID
        - $ref: '#/components/schemas/AccountStableName'
          description: Stable name associated with the account
          title: Account Stable Name
    AccountStableName:
      type: object
      properties:
        type:
          type: string
          description: Resource type. Value will be `StableName`.
          example: StableName
        stable_name:
          type: string
          example: CURRENT_ASSETS
          description: Stable name of the account
    ApiLedgerAccountType:
      type: object
      properties:
        value:
          $ref: '#/components/schemas/LedgerAccountType'
          description: Type of the account
        display_name:
          type: string
          description: Display name of the account type
          example: Asset
    ApiLedgerAccountSubtype:
      type: object
      properties:
        value:
          $ref: '#/components/schemas/LedgerAccountSubtype'
        display_name:
          type: string
          description: Display name of the account subtype
          example: Current Assets
    AccountCategorization:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: The ID of the Account.
        stable_name:
          type: string
          nullable: true
          description: The stable name for the account
          example: RENT
        category:
          type: string
          description: The account ID or stable name, whichever is present.
          example: RENT
        display_name:
          type: string
          description: The display name for the account
          example: Rent
      required:
        - id
        - category
        - display_name
    ExclusionCategorization:
      type: object
      properties:
        id:
          type: string
          description: The ID of the exclusion type
        display_name:
          type: string
          description: The display name of the exclusion type
      required:
        - id
        - category
        - display_name
    SplitCategorization:
      type: object
      properties:
        entries:
          type: array
          items:
            $ref: '#/components/schemas/SplitCategorizationEntry'
      required:
        - entries
    NestedApiCategorization:
      type: object
      oneOf:
        - $ref: '#/components/schemas/NestedAccountCategorization'
          title: AccountNested
        - $ref: '#/components/schemas/NestedOptionalCatetoryCategorization'
          title: OptionalAccountNested
        - $ref: '#/components/schemas/NestedExclusionCategorization'
          title: ExclusionNested
    MatchType:
      type: string
      enum:
        - TRANSFER
        - INVOICE_PAYMENT
        - PAYOUT
    ApiMatchDetails:
      type: object
      required:
        - id
        - amount
        - date
      properties:
        id:
          type: string
          format: uuid
          description: Layer's ID for the match
        amount:
          type: integer
          format: int64
          description: Monetary amount of the matched transaction, in cents
        date:
          type: string
          format: date-time
          description: Date that the matched transaction occurred
        description:
          type: string
          nullable: true
          description: Description of the match
          example: Transfer from SavingsAccount to CheckingAccount
    ApiBankTransactionInterface:
      type: object
      required:
        - id
        - amount
        - date
      properties:
        id:
          type: string
          format: uuid
          description: Layer's UUID for the bank transaction
        business_id:
          type: string
          format: uuid
          description: UUID of the business the transaction is for
        source:
          $ref: '#/components/schemas/TransactionSource'
          description: Source of the bank transaction.
        source_transaction_id:
          type: string
          description: >-
            External transaction ID from the source platform (e.g, Plaid
            transaction ID)
          example: g4DlKyjXqGH3Kp5XlaWMtwLRrE4Z9AiE8B4Ko
        source_account_id:
          type: string
          description: External account ID from the source platform (e.g, Plaid account ID)
          example: Aaoy8G7VXZHVeqNoL1GvcmkPdqpLRWi9NArdG
        imported_at:
          type: string
          format: date-time
          description: Timestamp when the transaction was imported.
        date:
          type: string
          format: date-time
          description: Timestamp when the transaction was created.
        direction:
          $ref: '#/components/schemas/BankTransactionDirection'
          description: Direction of the transaction.
        amount:
          type: integer
          format: int64
          description: Amount of the transaction, in cents.
        counterparty_name:
          type: string
          nullable: true
          description: Name of the transaction counterparty
          example: WeWork
        description:
          type: string
          nullable: true
          description: Description of the transaction.
          example: WeWork monthly rent payment
        account_name:
          type: string
          nullable: true
          description: Name of the bank account
          example: Plaid Checking
        categorizationStatus:
          $ref: '#/components/schemas/CategorizationStatus'
          description: The status of the transaction’s categorization in Layer’s systems.
        memo:
          type: string
          nullable: true
          description: >-
            Memo for any text you would like to associate with the bank
            transaction (for example, to display to end users).
        metadata:
          $ref: '#/components/schemas/PlatformDefinedJson'
          nullable: true
          description: Arbitrary custom metadata in JSON format with a size limit of 1KB
        reference_number:
          type: string
          nullable: true
          description: >-
            Any (typically user-visible) identifier you would like to associate
            with the bank transaction. Can be used to filter when listing bank
            transactions.
    SignedAmount:
      type: integer
      format: int64
    TaxAccountIdentifier:
      type: object
      oneOf:
        - $ref: '#/components/schemas/TaxName'
          title: Tax Name
        - $ref: '#/components/schemas/LedgerAccountIdentifier'
          title: Ledger Account ID
      discriminator:
        propertyName: type
        mapping:
          AccountId: '#/components/schemas/LedgerAccountIdentifier'
          Tax_Name: '#/components/schemas/TaxName'
    AccountId:
      type: object
      properties:
        type:
          type: string
          description: Resource type. Value will be `AccountId`.
          example: AccountId
        id:
          type: string
          format: uuid
          description: ID of the account
    LedgerAccountType:
      type: string
      enum:
        - ASSET
        - LIABILITY
        - EQUITY
        - REVENUE
        - COGS
        - EXPENSE
    LedgerAccountSubtype:
      type: string
      enum:
        - BANK_ACCOUNTS
        - ACCOUNTS_RECEIVABLE
        - INVENTORY
        - PAYMENT_PROCESSOR_CLEARING_ACCOUNT
        - FIXED_ASSET
        - ACCUMULATED_DEPRECIATION
        - CASH
        - UNDEPOSITED_FUNDS
        - CURRENT_ASSET
        - NON_CURRENT_ASSET
        - PREPAID_EXPENSES
        - DEVELOPMENT_COSTS
        - LOANS_RECEIVABLE
        - INTANGIBLE_ASSET
        - ACCOUNTS_PAYABLE
        - CREDIT_CARD
        - TAXES_PAYABLE
        - INCOME_TAXES_PAYABLE
        - SALES_TAXES_PAYABLE
        - OTHER_TAXES_PAYABLE
        - PAYROLL_TAXES_PAYABLE
        - UNEARNED_REVENUE
        - PAYROLL_LIABILITY
        - PAYROLL_CLEARING
        - LINE_OF_CREDIT
        - TIPS
        - REFUND_LIABILITIES
        - UNDEPOSITED_OUTFLOWS
        - OUTGOING_PAYMENT_CLEARING_ACCOUNT
        - OTHER_CURRENT_LIABILITY
        - LOANS_PAYABLE
        - NOTES_PAYABLE
        - SHAREHOLDER_LOAN
        - NON_CURRENT_LIABILITY
        - CONTRIBUTIONS
        - DISTRIBUTIONS
        - COMMON_STOCK
        - PREFERRED_STOCK
        - ADDITIONAL_PAID_IN_CAPITAL
        - RETAINED_EARNINGS
        - ACCUMULATED_ADJUSTMENTS
        - OPENING_BALANCE_EQUITY
        - OTHER_EQUITY
        - SALES
        - UNCATEGORIZED_REVENUE
        - RETURNS_ALLOWANCES
        - DIVIDEND_INCOME
        - INTEREST_INCOME
        - OTHER_INCOME
        - COGS
        - OPERATING_EXPENSES
        - PAYROLL
        - TAXES_LICENSES
        - UNCATEGORIZED_EXPENSE
        - CHARITABLE_CONTRIBUTIONS
        - LOAN_EXPENSES
        - FINANCE_COSTS
        - INTEREST_EXPENSES
        - DEPRECIATION
        - AMORTIZATION
        - BAD_DEBT
        - OTHER_EXPENSES
    SplitCategorizationEntry:
      type: object
      properties:
        amount:
          type: integer
          format: int64
          description: Amount of the parent transaction for this split entry.
        category:
          $ref: '#/components/schemas/AccountCategorization'
          description: Category for this split entry.
    NestedAccountCategorization:
      type: object
      description: A category that exists
      properties:
        type:
          type: string
          description: Resource type. Value will be 'AccountNested'.
          example: AccountNested
        id:
          type: string
          format: uuid
          description: The ID of the account
        stable_name:
          type: string
          nullable: true
          description: The stable name of the account
          example: EXPENSES
        display_name:
          type: string
          description: The display name of the account
          example: Expenses
        subCategories:
          $ref: '#/components/schemas/NestedApiSubCategories'
          description: The subcategories of the account
    NestedOptionalCatetoryCategorization:
      type: object
      description: A category that is not created by default
      properties:
        type:
          type: string
          description: Resource type. Value will be 'OptionalAccountNested'.
          example: '''OptionalAccountNested'''
        stable_name:
          type: string
          description: The stable name of the optional account
        display_name:
          type: string
          description: The display name of the optional account
        subCategories:
          $ref: '#/components/schemas/NestedApiSubCategories'
          description: The subcategories of the account
    NestedExclusionCategorization:
      type: object
      properties:
        type:
          type: string
          description: Resource type. Value will be 'ExclusionNested'.
          example: ExclusionNested
        id:
          type: string
          description: The ID of the exclusion type
        display_name:
          type: string
          description: The display name of the exclusion type
    TaxName:
      type: object
      properties:
        type:
          type: string
          description: Resource type. Value will be 'Tax_Name'.
          example: Tax_Name
        name:
          type: string
          description: Name of the ledger account
          example: CALIFORNIA_VAT
      required:
        - name
    LedgerAccountIdentifier:
      type: object
      properties:
        type:
          type: string
          description: Resource type. Value will be 'Ledger_Account_Identifier'.
          example: Ledger_Account_Identifier
        id:
          type: string
          format: uuid
          description: ID of the ledger account
      required:
        - id
    NestedApiSubCategories:
      type: array
      items:
        $ref: '#/components/schemas/NestedApiCategorization'
      nullable: true
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````