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

# Get Booking Item



## OpenAPI

````yaml https://app.usequanta.com/openapi/quanta-services-api/openapi.json get /api/booking/item/{qid}
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://app.usequanta.com
    description: Production
security:
  - HTTPBearer: []
paths:
  /api/booking/item/{qid}:
    get:
      tags:
        - booking
        - quanta-services-api
      summary: Get Booking Item
      operationId: get_booking_item
      parameters:
        - name: qid
          in: path
          required: true
          schema:
            type: string
            title: Qid
        - name: ledger_match
          in: query
          required: false
          schema:
            type: boolean
            description: >-
              Pass true to return the bidirectional, read-only ledger
              relationship used for UI display. By default, return only the
              directional match owned by this transaction for safe rebooking.
            default: false
            title: Ledger Match
          description: >-
            Pass true to return the bidirectional, read-only ledger relationship
            used for UI display. By default, return only the directional match
            owned by this transaction for safe rebooking.
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SpendBookingItemLedger'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    SpendBookingItemLedger:
      properties:
        spend:
          $ref: '#/components/schemas/Spend'
        recognition:
          anyOf:
            - $ref: >-
                #/components/schemas/src__schedule__schedule_defs__PrepaidSchedule
            - $ref: >-
                #/components/schemas/src__schedule__schedule_defs__FixedAssetSchedule
            - $ref: '#/components/schemas/AccruedExpense'
            - type: 'null'
          title: Recognition
        match_ledger:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/SourceMatchInfo'
                - $ref: '#/components/schemas/BalanceTransactionMatchInfo-Output'
              discriminator:
                propertyName: type
                mapping:
                  balance_transaction: '#/components/schemas/BalanceTransactionMatchInfo-Output'
                  source_match: '#/components/schemas/SourceMatchInfo'
            - type: 'null'
          title: Match Ledger
        paydown_ledger:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/InvoicePaydownLedger'
                - $ref: '#/components/schemas/ManualReceivablePaydownLedger'
              discriminator:
                propertyName: type
                mapping:
                  invoice: '#/components/schemas/InvoicePaydownLedger'
                  manual_receivable: '#/components/schemas/ManualReceivablePaydownLedger'
            - type: 'null'
          title: Paydown Ledger
      type: object
      required:
        - spend
      title: SpendBookingItemLedger
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    Spend:
      properties:
        qid:
          type: string
          title: Qid
        created_at:
          type: string
          format: date-time
          title: Created At
        org_qid:
          type: string
          title: Org Qid
        source:
          $ref: '#/components/schemas/Source'
        source_type:
          $ref: '#/components/schemas/SourceType'
        amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
        gl_account:
          anyOf:
            - $ref: '#/components/schemas/Account'
            - type: 'null'
        date_or_datetime:
          $ref: '#/components/schemas/DateOrDateTime'
        source_qid:
          type: string
          title: Source Qid
        currency:
          $ref: '#/components/schemas/Currency'
          default: USD
        vendor:
          anyOf:
            - $ref: '#/components/schemas/SpendTraitVendor'
            - type: 'null'
        customer:
          anyOf:
            - $ref: '#/components/schemas/Customer'
            - type: 'null'
        product:
          anyOf:
            - $ref: '#/components/schemas/Product'
            - type: 'null'
        department:
          anyOf:
            - $ref: '#/components/schemas/Department'
            - $ref: '#/components/schemas/NoDepartment'
          title: Department
        operational_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Operational Qid
        paydown_bt_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Paydown Bt Qid
        payroll_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Payroll Qid
        department_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Department Qid
        spend_trait_vendor_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Spend Trait Vendor Qid
        customer_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Qid
        product_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Product Qid
        gl_account_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Gl Account Qid
        entity_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Entity Qid
        vendor_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Vendor Name
        deleted_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Deleted At
        description:
          type: string
          title: Description
          default: N/A
      type: object
      required:
        - qid
        - created_at
        - org_qid
        - source
        - source_type
        - amount
        - gl_account
        - date_or_datetime
        - source_qid
      title: Spend
    src__schedule__schedule_defs__PrepaidSchedule:
      properties:
        qid:
          type: string
          title: Qid
        org_qid:
          type: string
          title: Org Qid
        total_amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Total Amount
        source_qid:
          type: string
          title: Source Qid
        service_start_date:
          type: string
          format: date
          title: Service Start Date
        items:
          items:
            $ref: >-
              #/components/schemas/src__schedule__schedule_defs__PrepaidScheduleItem
          type: array
          title: Items
        booking_info:
          anyOf:
            - $ref: '#/components/schemas/PrepaidSpendBookingInfo'
            - $ref: '#/components/schemas/PrepaidStandaloneBookingInfo'
          title: Booking Info
        spend_trait_vendor_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Spend Trait Vendor Qid
        department_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Department Qid
        vendor_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Vendor Name
        vendor_image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Vendor Image Url
        department_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Department Name
        account_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Account Name
        purchase_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Purchase Date
      type: object
      required:
        - qid
        - org_qid
        - total_amount
        - source_qid
        - service_start_date
        - items
        - booking_info
        - spend_trait_vendor_qid
        - department_qid
      title: PrepaidSchedule
    src__schedule__schedule_defs__FixedAssetSchedule:
      properties:
        qid:
          type: string
          title: Qid
        org_qid:
          type: string
          title: Org Qid
        source_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Qid
        service_start_date:
          type: string
          format: date
          title: Service Start Date
        total_amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Total Amount
        lifetime_months:
          type: integer
          title: Lifetime Months
        write_off_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Write Off Date
        amortization_granularity:
          $ref: '#/components/schemas/AmortizationGranularity'
        items:
          items:
            $ref: '#/components/schemas/FixedAssetScheduleItem'
          type: array
          title: Items
        purchase_date:
          type: string
          format: date
          title: Purchase Date
        type:
          $ref: '#/components/schemas/FixedAssetType'
        purchase_amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Purchase Amount
        salvage_value:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Salvage Value
        spend_trait_vendor_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Spend Trait Vendor Qid
        department_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Department Qid
        vendor_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Vendor Name
        vendor_image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Vendor Image Url
        department_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Department Name
      type: object
      required:
        - qid
        - org_qid
        - source_qid
        - service_start_date
        - total_amount
        - lifetime_months
        - write_off_date
        - amortization_granularity
        - items
        - purchase_date
        - type
        - purchase_amount
        - salvage_value
        - spend_trait_vendor_qid
        - department_qid
      title: FixedAssetSchedule
    AccruedExpense:
      properties:
        qid:
          type: string
          title: Qid
        org_qid:
          type: string
          title: Org Qid
        amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
        gl_account_qid:
          type: string
          title: Gl Account Qid
        booking_data:
          $ref: '#/components/schemas/OneOffBookingData'
        memo:
          type: string
          title: Memo
        private_memo:
          type: string
          title: Private Memo
        spend_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Spend Qid
        source_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Qid
        reversal_source_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Reversal Source Qid
        reversal_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Reversal Date
        spend_trait_vendor_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Spend Trait Vendor Qid
        department_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Department Qid
      type: object
      required:
        - qid
        - org_qid
        - amount
        - gl_account_qid
        - booking_data
        - memo
        - private_memo
        - spend_qid
      title: AccruedExpense
    SourceMatchInfo:
      properties:
        type:
          type: string
          const: source_match
          title: Type
        targets:
          items:
            $ref: '#/components/schemas/SourceMatchTarget'
          type: array
          minItems: 1
          title: Targets
      type: object
      required:
        - type
        - targets
      title: SourceMatchInfo
    BalanceTransactionMatchInfo-Output:
      properties:
        type:
          type: string
          const: balance_transaction
          title: Type
        transaction_qids:
          items:
            $ref: '#/components/schemas/BalanceTransactionMatch-Output'
          type: array
          minItems: 1
          title: Transaction Qids
      type: object
      required:
        - type
        - transaction_qids
      title: BalanceTransactionMatchInfo
    InvoicePaydownLedger:
      properties:
        paydown:
          $ref: '#/components/schemas/PaydownBookingItemData'
        credit_remaining:
          anyOf:
            - $ref: '#/components/schemas/AllocationCreditRemaining-Output'
            - type: 'null'
        expense_remaining:
          anyOf:
            - $ref: '#/components/schemas/AllocationExpenseRemaining-Output'
            - type: 'null'
        type:
          type: string
          const: invoice
          title: Type
          default: invoice
        paydown_bt_qid:
          type: string
          title: Paydown Bt Qid
        allocation:
          $ref: '#/components/schemas/InvoicePaymentAllocationResult'
      type: object
      required:
        - paydown
        - paydown_bt_qid
        - allocation
      title: InvoicePaydownLedger
    ManualReceivablePaydownLedger:
      properties:
        paydown:
          $ref: '#/components/schemas/PaydownBookingItemData'
        credit_remaining:
          anyOf:
            - $ref: '#/components/schemas/AllocationCreditRemaining-Output'
            - type: 'null'
        expense_remaining:
          anyOf:
            - $ref: '#/components/schemas/AllocationExpenseRemaining-Output'
            - type: 'null'
        type:
          type: string
          const: manual_receivable
          title: Type
          default: manual_receivable
        paydown_bt_qid:
          type: string
          title: Paydown Bt Qid
      type: object
      required:
        - paydown
        - paydown_bt_qid
      title: ManualReceivablePaydownLedger
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    Source:
      type: string
      enum:
        - quanta
        - amex
        - deel
        - qbo
        - ramp
        - ramp_bank
        - rippling
        - stripe
        - gusto
        - brex
        - frb
        - fidelity
        - justworks
        - sequoia_one
        - chase
        - wells_fargo_ceo
        - mercury
        - meow_bank
        - bank_of_america
        - svb
        - morgan_stanley
        - other_bank
        - other_finicity_bank
        - angellist_banking
        - arc
        - carta
        - manual
        - bank_upload
        - local_bank
        - card_upload
        - reimbursement_upload
        - warp
        - rho
        - stifel
        - highbeam
        - erebor
        - wise
        - td_canada
        - central_payroll
        - rillet
        - campfire
        - netsuite
        - orb
        - prepaid
        - loan
        - accrued_expense
        - pricing_component
        - invoice_sent
        - fixed_asset
        - intangible_asset
        - stripe_invoice
        - payment_event
        - month_end_event
        - out_of_band_invoice
        - derivative_payable
      title: Source
    SourceType:
      type: string
      enum:
        - bank
        - credit_card
        - stripe_balance_transaction
        - reimbursement
        - payroll_reimbursement
        - billpay
        - payroll
        - operational
      title: SourceType
    Account:
      properties:
        org_qid:
          type: string
          title: Org Qid
        qid:
          type: string
          title: Qid
        name:
          type: string
          title: Name
        type:
          $ref: '#/components/schemas/AccountType'
        lookup_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Lookup Id
        overrides:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Overrides
        is_leaf_account:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Leaf Account
        booking_disabled_on:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Booking Disabled On
        number:
          anyOf:
            - type: string
            - type: 'null'
          title: Number
      type: object
      required:
        - org_qid
        - qid
        - name
        - type
      title: Account
    DateOrDateTime:
      properties:
        date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Date
        date_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Date Time
      type: object
      title: DateOrDateTime
    Currency:
      type: string
      enum:
        - AED
        - AFN
        - ALL
        - AMD
        - ANG
        - AOA
        - ARS
        - AUD
        - AWG
        - AZN
        - BAM
        - BBD
        - BDT
        - BGN
        - BHD
        - BIF
        - BMD
        - BND
        - BOB
        - BOV
        - BRL
        - BSD
        - BTN
        - BWP
        - BYN
        - BZD
        - CAD
        - CDF
        - CHE
        - CHF
        - CHW
        - CLF
        - CLP
        - CNY
        - COP
        - COU
        - CRC
        - CUC
        - CUP
        - CVE
        - CZK
        - DJF
        - DKK
        - DOP
        - DZD
        - EGP
        - ERN
        - ETB
        - EUR
        - FJD
        - FKP
        - GBP
        - GEL
        - GHS
        - GIP
        - GMD
        - GNF
        - GTQ
        - GYD
        - HKD
        - HNL
        - HTG
        - HUF
        - IDR
        - ILS
        - INR
        - IQD
        - IRR
        - ISK
        - JMD
        - JOD
        - JPY
        - KES
        - KGS
        - KHR
        - KMF
        - KPW
        - KRW
        - KWD
        - KYD
        - KZT
        - LAK
        - LBP
        - LKR
        - LRD
        - LSL
        - LYD
        - MAD
        - MDL
        - MGA
        - MKD
        - MMK
        - MNT
        - MOP
        - MRU
        - MUR
        - MVR
        - MWK
        - MXN
        - MXV
        - MYR
        - MZN
        - NAD
        - NGN
        - NIO
        - NOK
        - NPR
        - NZD
        - OMR
        - PAB
        - PEN
        - PGK
        - PHP
        - PKR
        - PLN
        - PYG
        - QAR
        - RON
        - RSD
        - RUB
        - RWF
        - SAR
        - SBD
        - SCR
        - SDG
        - SEK
        - SGD
        - SHP
        - SLE
        - SLL
        - SOS
        - SRD
        - SSP
        - STN
        - SVC
        - SYP
        - SZL
        - THB
        - TJS
        - TMT
        - TND
        - TOP
        - TRY
        - TTD
        - TWD
        - TZS
        - UAH
        - UGX
        - USD
        - USN
        - UYI
        - UYU
        - UYW
        - UZS
        - VED
        - VES
        - VND
        - VUV
        - WST
        - XAF
        - XCD
        - XDR
        - XOF
        - XPF
        - XSU
        - XUA
        - YER
        - ZAR
        - ZMW
        - ZWL
      title: Currency
    SpendTraitVendor:
      properties:
        qid:
          type: string
          title: Qid
        name:
          type: string
          title: Name
        department_trait:
          anyOf:
            - $ref: '#/components/schemas/SpendTraitDepartment'
            - type: 'null'
        org_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Org Qid
        context:
          anyOf:
            - $ref: '#/components/schemas/SpendTraitVendorContext'
            - type: 'null'
        created_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Created At
        vendor_image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Vendor Image Url
        usage_count:
          anyOf:
            - type: integer
            - type: 'null'
          title: Usage Count
      type: object
      required:
        - qid
        - name
      title: SpendTraitVendor
    Customer:
      properties:
        qid:
          type: string
          title: Qid
        org_qid:
          type: string
          title: Org Qid
        source:
          $ref: '#/components/schemas/Source'
        source_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Qid
        name:
          anyOf:
            - type: string
            - type: 'null'
          title: Name
        source_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Id
        image_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Image Url
      type: object
      required:
        - qid
        - org_qid
        - source
        - source_qid
        - name
        - source_id
        - image_url
      title: Customer
    Product:
      properties:
        qid:
          type: string
          title: Qid
        org_qid:
          type: string
          title: Org Qid
        source:
          $ref: '#/components/schemas/Source'
        source_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Qid
        name:
          type: string
          title: Name
        source_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Id
      type: object
      required:
        - qid
        - org_qid
        - source
        - source_qid
        - name
        - source_id
      title: Product
    Department:
      properties:
        qid:
          type: string
          title: Qid
        org_qid:
          type: string
          title: Org Qid
        source:
          $ref: '#/components/schemas/OrganizationSource'
        source_qid:
          type: string
          title: Source Qid
        name:
          type: string
          title: Name
        parent_department_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Parent Department Qid
        group_name:
          anyOf:
            - type: string
            - type: 'null'
          title: Group Name
      type: object
      required:
        - qid
        - org_qid
        - source
        - source_qid
        - name
      title: Department
    NoDepartment:
      properties:
        qid:
          type: 'null'
          title: Qid
        name:
          type: 'null'
          title: Name
      type: object
      title: NoDepartment
    src__schedule__schedule_defs__PrepaidScheduleItem:
      properties:
        qid:
          type: string
          title: Qid
        org_qid:
          type: string
          title: Org Qid
        schedule_qid:
          type: string
          title: Schedule Qid
        amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
        effective_date:
          type: string
          format: date
          title: Effective Date
        booked_at:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Booked At
        deprecated_at:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Deprecated At
        pre_quanta:
          type: boolean
          title: Pre Quanta
      type: object
      required:
        - qid
        - org_qid
        - schedule_qid
        - amount
        - effective_date
        - booked_at
        - deprecated_at
        - pre_quanta
      title: PrepaidScheduleItem
    PrepaidSpendBookingInfo:
      properties:
        source_qid:
          type: string
          title: Source Qid
      type: object
      required:
        - source_qid
      title: PrepaidSpendBookingInfo
    PrepaidStandaloneBookingInfo:
      properties:
        account_qid:
          type: string
          title: Account Qid
      type: object
      required:
        - account_qid
      title: PrepaidStandaloneBookingInfo
    AmortizationGranularity:
      type: string
      enum:
        - monthly_evenly
        - monthly_ends_prorated
        - millisecond
        - manual
      title: AmortizationGranularity
    FixedAssetScheduleItem:
      properties:
        qid:
          type: string
          title: Qid
        org_qid:
          type: string
          title: Org Qid
        schedule_qid:
          type: string
          title: Schedule Qid
        amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
        effective_date:
          type: string
          format: date
          title: Effective Date
        booked_at:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Booked At
        deprecated_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Deprecated At
        pre_quanta:
          type: boolean
          title: Pre Quanta
      type: object
      required:
        - qid
        - org_qid
        - schedule_qid
        - amount
        - effective_date
        - booked_at
        - deprecated_at
        - pre_quanta
      title: FixedAssetScheduleItem
    FixedAssetType:
      type: string
      enum:
        - Computer
        - Furniture
        - Leasehold Improvements
      title: FixedAssetType
    OneOffBookingData:
      properties:
        expense_date:
          type: string
          format: date
          title: Expense Date
      type: object
      required:
        - expense_date
      title: OneOffBookingData
    SourceMatchTarget:
      properties:
        qid:
          type: string
          title: Qid
        entity_type:
          type: string
          enum:
            - brex_reimbursement
            - ramp_reimbursement
            - reimbursement_bank_repayment
            - payroll
            - payroll_payment
            - payroll_liability_manual_adjustment
          title: Entity Type
      type: object
      required:
        - qid
        - entity_type
      title: SourceMatchTarget
    BalanceTransactionMatch-Output:
      properties:
        transaction_qid:
          type: string
          title: Transaction Qid
        source_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Qid
        amount:
          $ref: '#/components/schemas/MonetaryAmount-Output'
      type: object
      required:
        - transaction_qid
        - amount
      title: BalanceTransactionMatch
    PaydownBookingItemData:
      properties:
        amount:
          $ref: '#/components/schemas/MonetaryAmount-Output'
        description:
          type: string
          title: Description
        target_transaction_qid:
          type: string
          title: Target Transaction Qid
        gl_account:
          $ref: '#/components/schemas/Account'
      type: object
      required:
        - amount
        - description
        - target_transaction_qid
        - gl_account
      title: PaydownBookingItemData
      description: >-
        Books part of a booking against another transaction's open balance.

        ``target_transaction_qid`` selects the balance being paid down; booking
        the

        item persists a reversing balance transaction on its ledger

        plus the matching journal entry line (carrying ``description``) on its

        account. Positive amounts pay down accounts payable; negative amounts
        pay

        down accounts receivable. Negative accounts payable amounts reopen a
        bill

        whose payment was returned.
    AllocationCreditRemaining-Output:
      properties:
        credit_remaining_amount:
          $ref: '#/components/schemas/MonetaryAmount-Output'
        user_qid:
          type: string
          title: User Qid
        admin_email:
          type: string
          title: Admin Email
      type: object
      required:
        - credit_remaining_amount
        - user_qid
        - admin_email
      title: AllocationCreditRemaining
    AllocationExpenseRemaining-Output:
      properties:
        expense_remaining_amount:
          $ref: '#/components/schemas/MonetaryAmount-Output'
        expense_remaining_gl_account_qid:
          type: string
          title: Expense Remaining Gl Account Qid
      type: object
      required:
        - expense_remaining_amount
        - expense_remaining_gl_account_qid
      title: AllocationExpenseRemaining
    InvoicePaymentAllocationResult:
      properties:
        invoice_source_qid:
          type: string
          title: Invoice Source Qid
        balance_transaction:
          $ref: '#/components/schemas/BalanceTransaction'
        expense_balance_transaction:
          anyOf:
            - $ref: '#/components/schemas/BalanceTransaction'
            - type: 'null'
        credit_note:
          anyOf:
            - $ref: '#/components/schemas/InvoiceMemo'
            - type: 'null'
      type: object
      required:
        - invoice_source_qid
        - balance_transaction
      title: InvoicePaymentAllocationResult
    AccountType:
      type: string
      enum:
        - ACCOUNTS_RECEIVABLE
        - BANK
        - FIXED_ASSET
        - OTHER_ASSET
        - OTHER_CURRENT_ASSET
        - ACCOUNTS_PAYABLE
        - CREDIT_CARD
        - OTHER_CURRENT_LIABILITY
        - LONG_TERM_LIABILITY
        - EQUITY
        - INCOME
        - OTHER_INCOME
        - COST_OF_GOODS_SOLD
        - EXPENSE
        - OTHER_EXPENSE
      title: AccountType
    SpendTraitDepartment:
      properties:
        qid:
          type: string
          title: Qid
        name:
          type: string
          title: Name
      type: object
      required:
        - qid
        - name
      title: SpendTraitDepartment
    SpendTraitVendorContext:
      properties:
        source_txn_qid:
          type: string
          title: Source Txn Qid
        second_org_source_txn_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Second Org Source Txn Qid
      type: object
      required:
        - source_txn_qid
      title: SpendTraitVendorContext
    OrganizationSource:
      type: string
      enum:
        - Brex
        - Deel
        - Gusto
        - Justworks
        - Rippling
        - Ramp
        - Manual
        - Mercury
        - SequoiaOne
        - Central
        - Warp
      title: OrganizationSource
    MonetaryAmount-Output:
      properties:
        amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
        currency:
          $ref: '#/components/schemas/Currency'
      type: object
      required:
        - amount
        - currency
      title: MonetaryAmount
      description: Immutable monetary value with currency.
    BalanceTransaction:
      properties:
        qid:
          type: string
          title: Qid
        org_qid:
          type: string
          title: Org Qid
        transaction_qid:
          type: string
          title: Transaction Qid
        account_qid:
          type: string
          title: Account Qid
        amount:
          $ref: '#/components/schemas/MonetaryAmount-Output'
        effective_date:
          type: string
          format: date
          title: Effective Date
        reversed_by:
          anyOf:
            - type: string
            - type: 'null'
          title: Reversed By
        event_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Event Qid
        event_type:
          anyOf:
            - $ref: '#/components/schemas/BalanceTransactionEventType'
            - type: 'null'
        matched_transaction_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Matched Transaction Qid
        matched_source_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Matched Source Qid
      type: object
      required:
        - qid
        - org_qid
        - transaction_qid
        - account_qid
        - amount
        - effective_date
      title: BalanceTransaction
    InvoiceMemo:
      properties:
        qid:
          type: string
          title: Qid
        org_qid:
          type: string
          title: Org Qid
        source:
          $ref: '#/components/schemas/Source'
        source_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Id
        source_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Qid
        source_type:
          $ref: '#/components/schemas/InvoiceMemoSourceType'
        invoice_qid:
          type: string
          title: Invoice Qid
        customer_qid:
          type: string
          title: Customer Qid
        number:
          type: string
          title: Number
        total:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Total
        items:
          items:
            $ref: '#/components/schemas/InvoiceMemoItem'
          type: array
          title: Items
        effective_at:
          type: string
          format: date-time
          title: Effective At
        metadata:
          additionalProperties: true
          type: object
          title: Metadata
      type: object
      required:
        - qid
        - org_qid
        - source
        - source_id
        - source_qid
        - source_type
        - invoice_qid
        - customer_qid
        - number
        - total
        - items
        - effective_at
      title: InvoiceMemo
    BalanceTransactionEventType:
      anyOf:
        - $ref: '#/components/schemas/OperationalEventType'
        - $ref: '#/components/schemas/InvoiceLedgerEventType'
    InvoiceMemoSourceType:
      type: string
      enum:
        - bad_debt_writeoff
        - credit_note_pre_payment
        - credit_note_post_payment
        - credit_note_mixed
        - dispute
        - dispute_reversal
        - manual
        - payment_failure_refund
        - refund
        - refund_failure
      title: InvoiceMemoSourceType
    InvoiceMemoItem:
      properties:
        qid:
          type: string
          title: Qid
        org_qid:
          type: string
          title: Org Qid
        invoice_memo_qid:
          type: string
          title: Invoice Memo Qid
        invoice_item_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Invoice Item Qid
        source:
          $ref: '#/components/schemas/Source'
        source_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Id
        source_type:
          $ref: '#/components/schemas/InvoiceMemoSourceType'
        product_amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Product Amount
        discount_amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Discount Amount
        subtotal:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Subtotal
        tax_amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Tax Amount
        fee_amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Fee Amount
        total:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Total
        service_period:
          $ref: '#/components/schemas/ServicePeriodDatetimes'
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
        discounts:
          items:
            $ref: '#/components/schemas/InvoiceMemoItemDiscount'
          type: array
          title: Discounts
      type: object
      required:
        - qid
        - org_qid
        - invoice_memo_qid
        - invoice_item_qid
        - source
        - source_id
        - source_type
        - product_amount
        - discount_amount
        - subtotal
        - tax_amount
        - fee_amount
        - total
        - service_period
        - description
        - discounts
      title: InvoiceMemoItem
    OperationalEventType:
      type: string
      enum:
        - BILLPAY_CREATE
        - BILLPAY_AMEND
        - BILLPAY_ARCHIVE
        - BILLPAY_MEMO_CREATE
        - BOOKING_UPDATE
        - REIMBURSEMENT_CREATE
        - REIMBURSEMENT_AMEND
        - REIMBURSEMENT_ARCHIVE
        - REIMBURSEMENT_MEMO_CREATE
        - ACCRUAL_CREATE
        - ACCOUNT_CREATE
        - ACCOUNT_AMEND
        - ACCOUNT_ARCHIVE
      title: OperationalEventType
    InvoiceLedgerEventType:
      type: string
      enum:
        - credit_note_created
        - credit_note_updated
        - credit_note_voided
        - customer_credit_applied
        - customer_credit_application_reversed
        - dispute_created
        - dispute_reversal_created
        - invoice_created
        - invoice_uncollectible
        - invoice_voided
        - payment_created
        - payment_reversed
        - payment_failure_refund_created
        - refund_created
        - refund_failure_created
        - booking_updated
        - schedule_items_updated
        - service_period_updated
        - invoice_metadata_updated
      title: InvoiceLedgerEventType
    ServicePeriodDatetimes:
      properties:
        start:
          type: string
          format: date-time
          title: Start
        end_exclusive:
          type: string
          format: date-time
          title: End Exclusive
      type: object
      required:
        - start
        - end_exclusive
      title: ServicePeriodDatetimes
    InvoiceMemoItemDiscount:
      properties:
        qid:
          type: string
          title: Qid
        org_qid:
          type: string
          title: Org Qid
        source:
          $ref: '#/components/schemas/Source'
        source_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Id
        invoice_qid:
          type: string
          title: Invoice Qid
        invoice_memo_item_qid:
          type: string
          title: Invoice Memo Item Qid
        amount:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
        description:
          anyOf:
            - type: string
            - type: 'null'
          title: Description
      type: object
      required:
        - qid
        - org_qid
        - source
        - source_id
        - invoice_qid
        - invoice_memo_item_qid
        - amount
      title: InvoiceMemoItemDiscount
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Quanta Services API scoped bearer token. Supported only on Services API
        routes.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.