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

# Update Booking

> Rebook a spend and record the manual change.



## OpenAPI

````yaml https://app.usequanta.com/openapi/quanta-services-api/openapi.json post /api/booking/update
openapi: 3.1.0
info:
  title: FastAPI
  version: 0.1.0
servers:
  - url: https://app.usequanta.com
    description: Production
security:
  - HTTPBearer: []
paths:
  /api/booking/update:
    post:
      tags:
        - booking
        - quanta-services-api
      summary: Update Booking
      description: Rebook a spend and record the manual change.
      operationId: update_booking
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BookingUpdateRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BookingUpdateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    BookingUpdateRequest:
      properties:
        source_qid:
          type: string
          title: Source Qid
        balance_account_qid:
          type: string
          title: Balance Account Qid
        reason:
          anyOf:
            - type: string
            - type: 'null'
          title: Reason
        spend_booking_items:
          items:
            anyOf:
              - $ref: '#/components/schemas/VendorBookingItemUpdateRequest'
              - $ref: '#/components/schemas/CustomerBookingUpdateRequest'
          type: array
          minItems: 1
          title: Spend Booking Items
      type: object
      required:
        - source_qid
        - balance_account_qid
        - spend_booking_items
      title: BookingUpdateRequest
      description: The complete replacement booking for a legacy source-backed spend.
    BookingUpdateResponse:
      properties:
        event_qid:
          type: string
          title: Event Qid
        journal_entry_qid:
          type: string
          title: Journal Entry Qid
        rebooked:
          type: boolean
          title: Rebooked
      type: object
      required:
        - event_qid
        - journal_entry_qid
        - rebooked
      title: BookingUpdateResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    VendorBookingItemUpdateRequest:
      properties:
        amount:
          $ref: '#/components/schemas/MonetaryAmount-Input'
        description:
          type: string
          title: Description
        gl_account_qid:
          type: string
          title: Gl Account Qid
        vendor_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Vendor Qid
        department_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Department Qid
        recognition:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/PrepaidSpec'
                - $ref: '#/components/schemas/PrepaidData-Input'
                - $ref: '#/components/schemas/FixedAssetSpec'
                - $ref: '#/components/schemas/FixedAssetData-Input'
                - $ref: '#/components/schemas/LegacyAccrualSpec'
              discriminator:
                propertyName: vendor_recognition_type
                mapping:
                  ACCRUAL_SPEC: '#/components/schemas/LegacyAccrualSpec'
                  FIXED_ASSET_DATA: '#/components/schemas/FixedAssetData-Input'
                  FIXED_ASSET_SPEC: '#/components/schemas/FixedAssetSpec'
                  PREPAID_DATA: '#/components/schemas/PrepaidData-Input'
                  PREPAID_SPEC: '#/components/schemas/PrepaidSpec'
            - type: 'null'
          title: Recognition
        match:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/SourceMatchInfo'
                - $ref: '#/components/schemas/BalanceTransactionMatchInfo-Input'
              discriminator:
                propertyName: type
                mapping:
                  balance_transaction: '#/components/schemas/BalanceTransactionMatchInfo-Input'
                  source_match: '#/components/schemas/SourceMatchInfo'
            - type: 'null'
          title: Match
        booking_item_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Booking Item Qid
      additionalProperties: false
      type: object
      required:
        - amount
        - description
        - gl_account_qid
      title: VendorBookingItemUpdateRequest
      description: Endpoint-only identity used to preserve an existing split booking item.
    CustomerBookingUpdateRequest:
      properties:
        amount:
          $ref: '#/components/schemas/MonetaryAmount-Input'
        description:
          type: string
          title: Description
        gl_account_qid:
          type: string
          title: Gl Account Qid
        customer_qid:
          type: string
          title: Customer Qid
        product_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Product Qid
        recognition:
          anyOf:
            - $ref: '#/components/schemas/RevenueScheduleSpec'
            - $ref: '#/components/schemas/RevenueScheduleData-Input'
            - type: 'null'
          title: Recognition
        match:
          anyOf:
            - oneOf:
                - $ref: '#/components/schemas/SourceMatchInfo'
                - $ref: '#/components/schemas/BalanceTransactionMatchInfo-Input'
              discriminator:
                propertyName: type
                mapping:
                  balance_transaction: '#/components/schemas/BalanceTransactionMatchInfo-Input'
                  source_match: '#/components/schemas/SourceMatchInfo'
            - type: 'null'
          title: Match
        paydown_data:
          anyOf:
            - $ref: '#/components/schemas/PaydownItemRequest-Input'
            - type: 'null'
        booking_item_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Booking Item Qid
      additionalProperties: false
      type: object
      required:
        - amount
        - description
        - gl_account_qid
        - customer_qid
      title: CustomerBookingUpdateRequest
    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
    MonetaryAmount-Input:
      properties:
        amount:
          anyOf:
            - type: number
            - 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.
    PrepaidSpec:
      properties:
        vendor_recognition_type:
          type: string
          const: PREPAID_SPEC
          title: Vendor Recognition Type
          default: PREPAID_SPEC
        num_amortization_months:
          type: integer
          title: Num Amortization Months
        start_date:
          type: string
          format: date
          title: Start Date
        effective_day_of_the_month:
          $ref: '#/components/schemas/EffectiveDayOfTheMonth'
          default: last
      type: object
      required:
        - num_amortization_months
        - start_date
      title: PrepaidSpec
    PrepaidData-Input:
      properties:
        vendor_recognition_type:
          type: string
          const: PREPAID_DATA
          title: Vendor Recognition Type
          default: PREPAID_DATA
        items:
          items:
            $ref: '#/components/schemas/PrepaidItemData-Input'
          type: array
          minItems: 1
          title: Items
        service_start_date:
          anyOf:
            - type: string
              format: date
            - type: 'null'
          title: Service Start Date
      type: object
      required:
        - items
      title: PrepaidData
    FixedAssetSpec:
      properties:
        vendor_recognition_type:
          type: string
          const: FIXED_ASSET_SPEC
          title: Vendor Recognition Type
          default: FIXED_ASSET_SPEC
        asset_type:
          $ref: '#/components/schemas/FixedAssetType'
        lifetime_months:
          anyOf:
            - type: integer
            - type: 'null'
          title: Lifetime Months
        service_start_date:
          type: string
          format: date
          title: Service Start Date
      type: object
      required:
        - asset_type
        - service_start_date
      title: FixedAssetSpec
    FixedAssetData-Input:
      properties:
        vendor_recognition_type:
          type: string
          const: FIXED_ASSET_DATA
          title: Vendor Recognition Type
          default: FIXED_ASSET_DATA
        asset_type:
          $ref: '#/components/schemas/FixedAssetType'
        purchase_date:
          type: string
          format: date
          title: Purchase Date
        items:
          items:
            $ref: '#/components/schemas/FixedAssetItemData-Input'
          type: array
          minItems: 1
          title: Items
      type: object
      required:
        - asset_type
        - purchase_date
        - items
      title: FixedAssetData
    LegacyAccrualSpec:
      properties:
        vendor_recognition_type:
          type: string
          const: ACCRUAL_SPEC
          title: Vendor Recognition Type
          default: ACCRUAL_SPEC
        accrual_date:
          type: string
          format: date
          title: Accrual Date
      type: object
      required:
        - accrual_date
      title: LegacyAccrualSpec
    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-Input:
      properties:
        type:
          type: string
          const: balance_transaction
          title: Type
        transaction_qids:
          items:
            $ref: '#/components/schemas/BalanceTransactionMatch-Input'
          type: array
          minItems: 1
          title: Transaction Qids
      type: object
      required:
        - type
        - transaction_qids
      title: BalanceTransactionMatchInfo
    RevenueScheduleSpec:
      properties:
        service_period:
          $ref: '#/components/schemas/ServicePeriodDates'
        amortization_granularity:
          anyOf:
            - $ref: '#/components/schemas/AmortizationGranularity'
            - type: 'null'
        apply_catch_up_revenue:
          type: boolean
          title: Apply Catch Up Revenue
          default: false
      type: object
      required:
        - service_period
      title: RevenueScheduleSpec
    RevenueScheduleData-Input:
      properties:
        service_period:
          $ref: '#/components/schemas/ServicePeriodDates'
        amortization_granularity:
          $ref: '#/components/schemas/AmortizationGranularity'
        items:
          items:
            $ref: '#/components/schemas/RevenueScheduleItemData-Input'
          type: array
          minItems: 1
          title: Items
        apply_catch_up_revenue:
          type: boolean
          title: Apply Catch Up Revenue
          default: false
      type: object
      required:
        - service_period
        - amortization_granularity
        - items
      title: RevenueScheduleData
    PaydownItemRequest-Input:
      properties:
        target_transaction_qid:
          type: string
          title: Target Transaction Qid
        amount:
          $ref: '#/components/schemas/MonetaryAmount-Input'
        credit_remaining:
          anyOf:
            - $ref: '#/components/schemas/AllocationCreditRemaining-Input'
            - type: 'null'
        expense_remaining:
          anyOf:
            - $ref: '#/components/schemas/AllocationExpenseRemaining-Input'
            - type: 'null'
      type: object
      required:
        - target_transaction_qid
        - amount
      title: PaydownItemRequest
    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
    EffectiveDayOfTheMonth:
      type: string
      enum:
        - first
        - last
      title: EffectiveDayOfTheMonth
    PrepaidItemData-Input:
      properties:
        amount:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
        effective_date:
          type: string
          format: date
          title: Effective Date
      type: object
      required:
        - amount
        - effective_date
      title: PrepaidItemData
    FixedAssetType:
      type: string
      enum:
        - Computer
        - Furniture
        - Leasehold Improvements
      title: FixedAssetType
    FixedAssetItemData-Input:
      properties:
        amount:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
        effective_date:
          type: string
          format: date
          title: Effective Date
      type: object
      required:
        - amount
        - effective_date
      title: FixedAssetItemData
    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-Input:
      properties:
        transaction_qid:
          type: string
          title: Transaction Qid
        source_qid:
          anyOf:
            - type: string
            - type: 'null'
          title: Source Qid
        amount:
          $ref: '#/components/schemas/MonetaryAmount-Input'
      type: object
      required:
        - transaction_qid
        - amount
      title: BalanceTransactionMatch
    ServicePeriodDates:
      properties:
        service_start_date:
          type: string
          format: date
          title: Service Start Date
        end_date_inclusive:
          type: string
          format: date
          title: End Date Inclusive
      type: object
      required:
        - service_start_date
        - end_date_inclusive
      title: ServicePeriodDates
    AmortizationGranularity:
      type: string
      enum:
        - monthly_evenly
        - monthly_ends_prorated
        - millisecond
        - manual
      title: AmortizationGranularity
    RevenueScheduleItemData-Input:
      properties:
        amount:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Amount
        effective_date:
          type: string
          format: date
          title: Effective Date
      type: object
      required:
        - amount
        - effective_date
      title: RevenueScheduleItemData
    AllocationCreditRemaining-Input:
      properties:
        credit_remaining_amount:
          $ref: '#/components/schemas/MonetaryAmount-Input'
        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-Input:
      properties:
        expense_remaining_amount:
          $ref: '#/components/schemas/MonetaryAmount-Input'
        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
  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.