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

# Create bill

> Creates a new bill for a business.



## OpenAPI

````yaml post /v1/businesses/{businessId}/bills
openapi: 3.0.1
info:
  title: API
  version: latest
servers: []
security:
  - BearerAuth: []
tags: []
externalDocs:
  url: /
paths:
  /v1/businesses/{businessId}/bills:
    post:
      tags: []
      summary: Create bill
      description: Creates a new bill for a business.
      operationId: business.bills.post
      parameters:
        - name: businessId
          in: path
          description: The UUID of the business to create the bill for.
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/NewBillPostParams'
      responses:
        '201':
          description: Bill created successfully.
          content:
            application/json:
              example:
                data:
                  id: b745c116-cd28-41a1-b4ea-84a2768b6e14
                  business_id: 188eb399-f171-4849-861c-5c02d91f800b
                  external_id: vendor-bill-123
                  status: PARTIALLY_PAID
                  terms: NET_30
                  received_at: '2024-06-01T10:11:57.184157Z'
                  due_at: '2024-07-01T10:11:57.184158Z'
                  paid_at: null
                  voided_at: null
                  reference_number: VB-123
                  vendor:
                    id: a4c38874-8c01-4986-b8d0-4f159a52dd39
                    external_id: vendor-1
                    company_name: Acme Supplies Inc.
                    email: billing@acmesupplies.com
                    office_phone: 555-123-4567
                    address_string: 123 Vendor St, Supply City, CA 90210
                    notes: Primary office supplies vendor
                    status: ACTIVE
                  line_items:
                    - id: 733de30f-db72-4d52-98c5-fe070d4433f7
                      external_id: bill-line-item-1
                      bill_id: b745c116-cd28-41a1-b4ea-84a2768b6e14
                      account_identifier:
                        type: AccountId
                        id: 80b708b5-7b27-456c-9fb1-b8b918241908
                      ledger_account:
                        id: 80b708b5-7b27-456c-9fb1-b8b918241908
                        name: Office Supplies
                        stable_name: OFFICE_SUPPLIES
                        normality: DEBIT
                        account_type:
                          value: EXPENSE
                          display_name: Expenses
                        account_subtype:
                          value: OPERATING_EXPENSES
                          display_name: Operating Expenses
                      description: Monthly office supplies
                      product_name: Paper reams
                      unit_price: 1500
                      quantity: '10.00'
                      subtotal: 15000
                      discount_amount: 1000
                      sales_taxes_total: 1120
                      sales_taxes:
                        - tax_account:
                            type: Tax_Name
                            name: CA_SALES_TAX
                          tax_ledger_account:
                            id: c4007474-f604-4d57-9690-b7f40f7a1cee
                            name: 'Sales tax: CA'
                            stable_name: SALES_TAXES:CA
                            normality: DEBIT
                            account_type:
                              value: EXPENSE
                              display_name: Expenses
                            account_subtype:
                              value: SALES_TAXES
                              display_name: Sales Taxes
                          amount: 1120
                      total_amount: 15120
                      transaction_tags:
                        - id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
                          key: department
                          value: operations
                          dimension_display_name: Department
                          value_display_name: Operations
                          dimension_id: d1e2f3a4-b5c6-7890-abcd-ef1234567890
                          definition_id: f1e2d3c4-b5a6-7890-abcd-ef1234567890
                          created_at: '2024-02-27T02:16:40.389772Z'
                          updated_at: '2024-02-27T02:16:40.389772Z'
                          deleted_at: null
                          archived_at: null
                  subtotal: 15000
                  additional_sales_taxes: []
                  additional_sales_taxes_total: 0
                  total_amount: 15120
                  outstanding_balance: 5120
                  memo: Memo for the office supplies purchase
                  payment_allocations:
                    - id: 8901abcd-ef23-4567-8901-abcd12345678
                      bill_id: b745c116-cd28-41a1-b4ea-84a2768b6e14
                      payment_id: 590ed436-c2bd-4e39-8047-f913a852f99c
                      amount: 10000
                      payment:
                        id: 590ed436-c2bd-4e39-8047-f913a852f99c
                        external_id: bill-payment-1
                        paid_at: '2024-06-15T00:00:00Z'
                        method: ACH
                        amount: 10000
                        processor: BANK_TRANSFER
                        imported_at: '2024-06-15T18:11:57.339076Z'
                        allocations:
                          - id: 8901abcd-ef23-4567-8901-abcd12345678
                            bill_id: b745c116-cd28-41a1-b4ea-84a2768b6e14
                            payment_id: 590ed436-c2bd-4e39-8047-f913a852f99c
                            amount: 10000
                            transaction_tags: []
                        transaction_tags: []
                        memo: First partial payment
                        metadata: {}
                        reference_number: PAY-1001
                      transaction_tags: []
                      memo: Allocated to June office supplies bill
                      metadata: {}
                      reference_number: ALLOC-1001
                  vendor_credits: []
                  imported_at: '2024-06-01T10:11:57.184157Z'
                  updated_at: '2024-06-15T18:11:57.339076Z'
                  transaction_tags: []
                  metadata: {}
              schema:
                $ref: '#/components/schemas/ApiBill'
components:
  schemas:
    NewBillPostParams:
      type: object
      required:
        - received_at
        - line_items
      properties:
        external_id:
          type: string
          description: External ID for the bill within your platform. **Idempotency key**.
        received_at:
          type: string
          format: date-time
          description: When the bill was received by the business from the vendor.
        due_at:
          type: string
          format: date-time
          description: >-
            When the bill is due. Either due_at or bill_terms must be specified,
            but not both.
        bill_terms:
          $ref: '#/components/schemas/BillTerms'
          description: >-
            Payment terms for the bill. Either due_at or bill_terms must be
            specified, but not both.
        additional_discount:
          type: integer
          format: int64
          nullable: true
          default: 0
          description: >-
            Additional discount applied to the whole bill in addition to
            individual line item discounts, in cents.
        memo:
          type: string
          description: >-
            Memo for any text you would like to associate with the bill (for
            example, to display to end users).
        vendor_id:
          type: string
          format: uuid
          description: >-
            ID of the vendor to associate with the bill. Either vendor_id or
            vendor_external_id must be specified.
        vendor_external_id:
          type: string
          description: >-
            External ID of the vendor to associate with the bill. Either
            vendor_id or vendor_external_id must be specified.
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/NewBillLineItem'
          description: Line items making up the bill.
        payments:
          type: array
          items:
            $ref: '#/components/schemas/CreateImmediateBillPaymentInput'
          description: Payments that have been made towards the balance of the bill.
        additional_sales_taxes:
          type: array
          items:
            $ref: '#/components/schemas/CreateTaxLineItem'
          description: Additional sales tax line items for the bill.
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagKeyValue'
        is_expense:
          type: boolean
          default: false
          description: Whether the bill should be treated as an expense.
        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 bill. Can be used to filter when listing bills.
    ApiBill:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the bill.
        business_id:
          type: string
          format: uuid
          description: ID of the Business that received the bill.
        external_id:
          type: string
          nullable: true
          description: Unique ID of the bill in your system.
        status:
          $ref: '#/components/schemas/BillStatus'
          description: Status of the bill.
        terms:
          $ref: '#/components/schemas/BillTerms'
          description: Payment terms of the bill.
        received_at:
          type: string
          format: date-time
          description: When the bill was received.
        due_at:
          type: string
          format: date-time
          nullable: true
          description: When the bill is due.
        paid_at:
          type: string
          format: date-time
          nullable: true
          description: When the bill was paid.
        voided_at:
          type: string
          format: date-time
          nullable: true
          description: When the bill was voided. Voiding excludes the bill from accounting.
        memo:
          type: string
          description: Memo for the bill for display.
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/ApiBillLineItem'
          description: Line items making up the bill.
        additional_sales_taxes:
          type: array
          items:
            $ref: '#/components/schemas/ApiBillTaxLineItem'
          description: Additional sales tax line items.
        additional_sales_taxes_total:
          type: integer
          description: Sum of all additional taxes in cents.
        additional_discount:
          type: integer
          format: int64
          description: >-
            Additional discount applied to the whole bill in addition to
            individual line item discounts, in cents.
        subtotal:
          type: integer
          description: Subtotal of all line items in cents.
        total_amount:
          type: integer
          description: Total amount including taxes in cents.
        outstanding_balance:
          type: integer
          description: Remaining balance after payments in cents.
        payment_allocations:
          type: array
          items:
            $ref: '#/components/schemas/ApiBillPaymentAllocationWithPayment'
          description: >-
            Payments made to a vendor are allocated toward one or many bills.
            This list shows which payments have been allocated toward this bill.
            The most common case is a 1:1 relationship between a payment and a
            bill, in which case the allocation amount matches the payment
            amount.
        vendor_credits:
          type: array
          items:
            $ref: '#/components/schemas/ApiVendorCreditAllocationWithVendorCredit'
          description: Vendor credit allocations for this bill.
        imported_at:
          type: string
          format: date-time
          description: When the bill was imported. **Eligible sort key**.
        updated_at:
          type: string
          format: date-time
          description: When the bill was last updated. **Eligible sort key**.
        vendor:
          $ref: '#/components/schemas/ApiVendorData'
          description: The vendor associated with this bill.
        transaction_tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiTag'
        is_expense:
          type: boolean
          description: Whether the bill is treated as an expense.
        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 bill. Can be used to filter when listing bills.
    BillTerms:
      type: string
      enum:
        - DUE_ON_RECEIPT
        - NET_10
        - NET_15
        - NET_30
        - NET_60
      description: Payment terms for the bill.
    NewBillLineItem:
      type: object
      required:
        - product_name
        - unit_price
      properties:
        external_id:
          type: string
          nullable: true
          description: The external ID of the bill line item in your system.
        account_identifier:
          $ref: '#/components/schemas/AccountIdentifier'
          description: Account identifier for the line item.
        prepayment_account_identifier:
          $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 bill line item.
        product_name:
          type: string
          description: Name of the product/service the line item is for.
        unit_price:
          type: integer
          format: int64
          description: Price of a single unit of the product (in cents).
        quantity:
          type: number
          format: bigdecimal
          nullable: true
          description: Number of units of the product purchased.
          default: 1
        discount_amount:
          type: integer
          format: int64
          description: Amount of discount applied to this line item in cents.
        sales_taxes:
          type: array
          items:
            $ref: '#/components/schemas/CreateTaxLineItem'
          nullable: true
          description: Sales tax line items for this line item.
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagKeyValue'
          nullable: true
          description: Tags for the bill line item.
        memo:
          type: string
          nullable: true
          description: >-
            Memo for any text you would like to associate with the bill line
            item.
        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 bill line item.
    CreateImmediateBillPaymentInput:
      type: object
      required:
        - method
        - amount
      properties:
        external_id:
          type: string
          nullable: true
          description: External ID for the payment.
        method:
          $ref: '#/components/schemas/PaymentMethod'
          description: Method used for payment.
        amount:
          type: integer
          format: int64
          description: Payment amount in cents.
        processor:
          type: string
          nullable: true
          description: Payment processor used.
        payment_clearing_account_identifier:
          $ref: '#/components/schemas/AccountIdentifier'
          description: >-
            The the ledger account to use for the payment (overrides the default
            determined by the payment method).
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagKeyValue'
        memo:
          type: string
          nullable: true
          description: >-
            Memo for any text you would like to associate with the bill payment
            (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 bill payment. Can be used to filter when listing bill
            payments.
    CreateTaxLineItem:
      type: object
      required:
        - amount
      properties:
        tax_account:
          $ref: '#/components/schemas/TaxAccountIdentifier'
          description: >-
            Tax identifier for this line item. Use a `Tax_Name` object to have
            Layer create or reuse a tax account by name, or use an `AccountId`
            or `StableName` account identifier when you want to target a
            specific ledger account.
        amount:
          type: integer
          format: int64
          description: Amount, in cents, of tax owed.
    TagKeyValue:
      type: object
      description: >-
        A TagKeyValue holds key=value data related to a tag. This is used when
        creating or updating taggable entities (transactions, invoices, etc.).
      properties:
        key:
          type: string
          description: The tag dimension key (e.g., "department", "project", "location").
          example: department
        dimension_display_name:
          type: string
          nullable: true
          description: >-
            If the TagDimension doesn't exist, providing this value specifies
            the display name upon database insertion. Otherwise, it is left as
            null on the TagDimension.
          example: Department
        value:
          type: string
          description: The tag value (e.g., "sales", "marketing", "engineering").
          example: sales
        value_display_name:
          type: string
          nullable: true
          description: >-
            If the TagValueDefinition doesn't exist, providing this value
            specifies the display name upon database insertion. Otherwise, it is
            left as null on the TagValueDefinition.
          example: Sales Department
      required:
        - key
        - value
    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: []
    BillStatus:
      type: string
      enum:
        - RECEIVED
        - PARTIALLY_PAID
        - PAID
        - VOIDED
    ApiBillLineItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: ID of the bill line item.
        external_id:
          type: string
          nullable: true
          description: The external ID of the bill line item in your system.
        bill_id:
          type: string
          format: uuid
          description: ID of the parent bill.
        account_identifier:
          $ref: '#/components/schemas/AccountIdentifier'
          description: Account identifier for the line item.
        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 bill line item.
        product_name:
          type: string
          description: Name of the product/service.
        unit_price:
          type: integer
          format: int64
          description: Price per unit in cents.
        quantity:
          type: number
          format: bigdecimal
          description: Number of units.
        subtotal:
          type: integer
          format: int64
          description: Subtotal for the line item in cents.
        discount_amount:
          type: integer
          format: int64
          description: Amount of discount in cents.
        sales_taxes:
          type: array
          items:
            $ref: '#/components/schemas/ApiBillTaxLineItem'
          description: Sales tax line items.
        sales_taxes_total:
          type: integer
          format: int64
          description: Total sales tax in cents.
        total_amount:
          type: integer
          format: int64
          description: Total amount including taxes and discounts.
        transaction_tags:
          type: array
          items:
            $ref: '#/components/schemas/TagKeyValue'
          description: Tags for the bill line item.
        memo:
          type: string
          nullable: true
          description: Memo associated with the bill line item.
        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 associated with the bill
            line item.
    ApiBillTaxLineItem:
      type: object
      properties:
        tax_account:
          $ref: '#/components/schemas/TaxAccountIdentifier'
          description: >-
            Tax account name or identifier. If not set, account defaults to the
            top level sales tax expense 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:CALIFORNIA
            normality: CREDIT
            account_type:
              value: EXPENSE
              display_name: Expenses
            account_subtype:
              value: SALES_TAXES
              display_name: Sales Taxes
        amount:
          type: integer
          format: int64
          description: Amount, in cents, of tax owed.
    ApiBillPaymentAllocationWithPayment:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the allocation.
        bill_id:
          type: string
          format: uuid
          description: ID of the bill.
        payment_id:
          type: string
          format: uuid
          description: ID of the payment.
        amount:
          type: integer
          format: int64
          description: >-
            Amount of the payment allocated toward this bill, in cents. If this
            amount equals the full payment amount, the payment was fully
            allocated toward this bill. The amount cannot exceed the bill total.
        payment:
          $ref: '#/components/schemas/ApiBillPayment'
          description: The full payment details.
        transaction_tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiTag'
          description: Tags associated with the allocation.
        memo:
          type: string
          nullable: true
          description: >-
            Memo for any text you would like to associate with the bill 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 bill payment allocation.
    ApiVendorCreditAllocationWithVendorCredit:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the vendor credit allocation.
        vendor_credit_id:
          type: string
          format: uuid
          description: UUID of the vendor credit this allocation belongs to.
        bill_id:
          type: string
          format: uuid
          description: UUID of the bill this allocation is for.
        amount:
          type: integer
          format: int64
          description: Amount for the allocation in cents.
        vendor_credit:
          $ref: '#/components/schemas/ApiVendorCredit'
          description: The vendor credit associated with this allocation.
      required:
        - id
        - vendor_credit_id
        - bill_payment_id
        - amount
        - vendor_credit
    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'
    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
    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
    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.
    PaymentMethod:
      type: string
      enum:
        - CASH
        - CHECK
        - CREDIT_CARD
        - ACH
        - CREDIT_BALANCE
        - OTHER
    TaxAccountIdentifier:
      type: object
      oneOf:
        - $ref: '#/components/schemas/TaxName'
          title: Tax Name
        - $ref: '#/components/schemas/AccountId'
          title: Ledger Account ID
        - $ref: '#/components/schemas/AccountStableName'
          title: Ledger Account Stable Name
      discriminator:
        propertyName: type
        mapping:
          AccountId:
            $ref: '#/components/schemas/AccountId'
          StableName:
            $ref: '#/components/schemas/AccountStableName'
          Tax_Name:
            $ref: '#/components/schemas/TaxName'
    ApiBillPayment:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the payment.
        external_id:
          type: string
          nullable: true
          description: External ID for the payment.
        at:
          type: string
          format: date-time
          description: When the payment was made.
        method:
          $ref: '#/components/schemas/PaymentMethod'
          description: Method used for payment.
        amount:
          type: integer
          format: int64
          description: Payment amount in cents.
        processor:
          type: string
          nullable: true
          description: Payment processor used.
        payment_clearing_account:
          $ref: '#/components/schemas/SingleApiChartAccount'
          description: >-
            The the ledger account to use for the payment (overrides the default
            determined by the payment method), if specified.
        imported_at:
          type: string
          format: date-time
          description: When the payment was imported.
        allocations:
          type: array
          items:
            $ref: '#/components/schemas/ApiBillPaymentAllocation'
          description: How the payment is allocated across bills.
        transaction_tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiTag'
          description: Tags associated with the payment.
        memo:
          type: string
          nullable: true
          description: >-
            Memo for any text you would like to associate with the bill payment
            (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 bill payment. Can be used to filter when listing bill
            payments.
    ApiVendorCredit:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the vendor credit.
        external_id:
          type: string
          description: External identifier for the vendor credit.
        vendor:
          $ref: '#/components/schemas/ApiVendorData'
          description: The vendor associated with this credit.
        received_at:
          type: string
          format: date-time
          description: Timestamp when the vendor credit was received.
        line_items:
          type: array
          items:
            $ref: '#/components/schemas/ApiVendorCreditLineItem'
          description: List of line items for this vendor credit.
        allocations:
          type: array
          items:
            $ref: '#/components/schemas/ApiVendorCreditAllocation'
          description: List of allocations for this vendor credit.
        created_at:
          type: string
          format: date-time
          description: Timestamp when the vendor credit was created.
        updated_at:
          type: string
          format: date-time
          description: Timestamp when the vendor credit was last updated.
        deleted_at:
          type: string
          format: date-time
          description: Timestamp when the vendor credit was deleted, if applicable.
        transaction_tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiTag'
          description: List of tags associated with this vendor credit.
        memo:
          type: string
          nullable: true
          description: >-
            Memo for any text you would like to associate with the vendor credit
            (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 vendor credit. Can be used to filter when listing vendor
            credits.
      required:
        - id
        - vendor
        - received_at
        - line_items
        - created_at
        - updated_at
        - transaction_tags
    AccountId:
      type: object
      required:
        - type
        - id
      properties:
        type:
          type: string
          enum:
            - AccountId
          description: Resource type. Value will be `AccountId`.
          example: AccountId
        id:
          type: string
          format: uuid
          description: ID of the account.
    AccountStableName:
      type: object
      required:
        - type
        - stable_name
      properties:
        type:
          type: string
          enum:
            - StableName
          description: Resource type. Value will be `StableName`.
          example: StableName
        stable_name:
          type: string
          example: CURRENT_ASSETS
          description: Stable name of the account.
    BankTransactionDirection:
      type: string
      enum:
        - CREDIT
        - DEBIT
    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
    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
    ApiBillPaymentAllocation:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the allocation.
        bill_id:
          type: string
          format: uuid
          description: ID of the bill.
        payment_id:
          type: string
          format: uuid
          description: ID of the payment.
        amount:
          type: integer
          format: int64
          description: >-
            Amount of the payment allocated toward this bill, in cents. If this
            amount equals the full payment amount, the payment was fully
            allocated toward this bill. The amount cannot exceed the bill total.
        transaction_tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiTag'
          description: Tags associated with the allocation.
        memo:
          type: string
          nullable: true
          description: >-
            Memo for any text you would like to associate with the bill 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 bill payment allocation.
    ApiVendorCreditLineItem:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the vendor credit line item.
        ledger_account:
          $ref: '#/components/schemas/SingleApiChartAccount'
          description: Ledger account for this line item.
        amount:
          type: integer
          format: int64
          description: Amount for the line item in cents.
        memo:
          type: string
          description: Description for the line item.
        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 vendor credit line item.
        transaction_tags:
          type: array
          items:
            $ref: '#/components/schemas/ApiTag'
          description: List of tags associated with this vendor credit line item.
      required:
        - id
        - amount
    ApiVendorCreditAllocation:
      type: object
      properties:
        id:
          type: string
          format: uuid
          description: Unique identifier for the vendor credit allocation.
        vendor_credit_id:
          type: string
          format: uuid
          description: UUID of the vendor credit this allocation belongs to.
        bill_id:
          type: string
          format: uuid
          description: UUID of the bill this allocation is for.
        amount:
          type: integer
          format: int64
          description: Amount for the allocation in cents.
      required:
        - id
        - vendor_credit_id
        - bill_payment_id
        - amount
    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
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````