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

# List budget summary reports

> qbXML: `BudgetSummaryReportQueryRq`, from qbXML 3.0.

Generates budget reports similar to the budget report functionality that is available within the QuickBooks UI. (From the main QB menubar select Reports->Budgets & Forecasts.) Note: the graphing functionality, forecasts, and memorized reports that available through the UI aren’t supported by the SDK. Notice that if you simply use the default instead of specifying the Fiscal Year, the `report_period` defaults to “year to date.” You can’t change the default to “This Fiscal Year.”

There can only be one balance sheet budget for each fiscal year, one profit and loss (P&L) by account budget per fiscal year, and one profit and loss (P&L) by account and customer budget per fiscal year. Hence the `fiscal_year` element is key in specifying which budget you want. Notice that there are two “views” into each of the two budget categories: the Overview, which shows the budget itself, and the Actual, which shows how expenditures are currently running against the budget.

All of the budget reports supported in the UI are supported in the SDK, although the UI and SDK nomenclature differs slightly. The UI shows Budget Overview and Budget Vs Actual as choices in the selection list, with Balance Sheet and P&L as subchoices in a subsequent selection list, already filtered by Accounts, or Accounts and Classes, or Accounts and Customers, if these are available.

In comparison, you choose the budget view you want via the SDK BudgetSummaryType element, which has these possible values:

- BalanceSheetBudgetOverview
- BalanceSheetBudgetVsActual
- ProfitAndLossBudgetOverview
- ProfitAndLossBudgetVsActual

Then you specify any additional filtering by the Budget Criterion value you specify (Accounts, AccountsAndCustomers, or AccountsAndClasses). Notice that before you can obtain a Budget report, the “target” budget must be defined in QuickBooks, via the UI, because you can’t create a budget via the SDK.

Intuit's reference: [BudgetSummaryReportQuery](https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/budgetsummaryreportquery).



## OpenAPI

````yaml /api-reference/v2/openapi.json get /connections/{connection_id}/budget-summary-reports
openapi: 3.1.0
info:
  contact:
    email: support@qubesync.com
  description: >
    A single generic operation surface for every curated qbXML request QuBe Sync
    supports, driven directly off the qbXML schema -- see the [MCP
    server](/mcp-server) to explore available operations interactively.


    **Every endpoint queues a request and returns it immediately (`201`, a
    `QueuedRequest`).** QuickBooks Desktop is reached through the customer's Web
    Connector, which polls QuBe Sync, so the answer arrives seconds to minutes
    later. **Pass a `webhook_url` with every request**: when QuickBooks has
    answered, QuBe Sync POSTs the same document to it -- `state` set,
    `response_json` filled in -- signed with `X-QUBE-Signature` (see the
    Webhooks guide). `response_json` is the `{status, data}` envelope documented
    on each operation: `status: "success"` with `data` derived from the qbXML
    `*Ret` (and `warning`, QuickBooks' code and message, when it carried the
    request out but warned about it), or `status: "error"` with QuickBooks' own
    status code and message -- a QuickBooks business error is a *successful*
    HTTP round trip. `links.self` returns the request on demand (for a
    dashboard, a retry, a script); it is not the integration path. Send an
    `Idempotency-Key` header with each request so a call whose answer you never
    got can be sent again without queueing it twice.


    Authentication is HTTP Basic with your app's API key as the username and a
    blank password. Connections themselves (creating one, onboarding, its QWC
    file and password) are the `/connections` endpoints; every QuickBooks
    operation is scoped to one of them.
  title: QuBe Sync API (v2)
  version: 2.0.0
servers:
  - description: v2 API
    url: https://qubesync.com/api/v2
  - description: Local development server
    url: https://dev.qubesync.com/api/v2
security:
  - apiKey: []
tags:
  - description: >-
      Creating and managing the connection (a customer's QuickBooks company
      file) that every request below is queued against. See the Onboarding
      guide.
    name: Connections
  - description: >-
      Queueing qbXML you wrote yourself, listing the requests queued on a
      connection, and discarding one the app no longer wants. A `webhook_url` on
      each request is the integration path (see the Webhooks guide): the listing
      is for a dashboard, a script, or catching up after downtime.
    name: Queued Requests
  - description: >-
      Finding the record in a customer's company file that a name means, even
      written differently: ranked matches from QuBe Sync's index of the file's
      names, on realtime and simulated connections. See the Matching guide.
    name: Matching
  - description: >-
      Endpoints for publishing workflow definitions, starting runs, and
      answering a run that is waiting on a decision from your app. A workflow is
      one JSON statechart document; see the schema at
      /api/v2/workflows/schema.json.
    name: Workflows
  - name: Account Tax Line Infos
  - name: Accounts
  - name: Aging Reports
  - name: Alerts
  - name: Ar Refund Credit Cards
  - name: Bar Codes
  - name: Bill Payment Checks
  - name: Bill Payment Credit Cards
  - name: Bill To Pays
  - name: Billing Rates
  - name: Bills
  - name: Budget Summary Reports
  - name: Build Assemblies
  - name: Charges
  - name: Checks
  - name: Classes
  - name: Cleared Statuses
  - name: Companies
  - name: Company Activities
  - name: Credit Card Charges
  - name: Credit Card Credits
  - name: Credit Memos
  - name: Currencies
  - name: Custom Detail Reports
  - name: Custom Summary Reports
  - name: Customer Msgs
  - name: Customer Types
  - name: Customers
  - name: Data Event Recovery Infos
  - name: Data Ext Defs
  - name: Data Exts
  - name: Date Driven Terms
  - name: Deposits
  - name: Employee Defaults
  - name: Employees
  - name: Entities
  - name: Estimates
  - name: Form1099 Category Account Mappings
  - name: General Detail Reports
  - name: General Summary Reports
  - name: Hosts
  - name: Inventory Adjustments
  - name: Inventory Sites
  - name: Invoices
  - name: Item Assemblies Can Builds
  - name: Item Discounts
  - name: Item Fixed Assets
  - name: Item Groups
  - name: Item Inventories
  - name: Item Inventory Assemblies
  - name: Item Non Inventories
  - name: Item Other Charges
  - name: Item Payments
  - name: Item Receipts
  - name: Item Sales Tax Groups
  - name: Item Sales Taxes
  - name: Item Services
  - name: Item Sites
  - name: Item Subtotals
  - name: Items
  - name: Job Reports
  - name: Job Types
  - name: Journal Entries
  - name: Leads
  - name: List Deleteds
  - name: List Displays
  - name: List Merge
  - name: Lists
  - name: Other Names
  - name: Paychecks
  - name: Payment Methods
  - name: Payments
  - name: Payroll Detail Reports
  - name: Payroll Item Additions
  - name: Payroll Item Company Contributions
  - name: Payroll Item Deductions
  - name: Payroll Item Direct Deposits
  - name: Payroll Item Non Wages
  - name: Payroll Item Taxes
  - name: Payroll Item Wages
  - name: Payroll Item Workers Compensations
  - name: Payroll Items
  - name: Payroll Last Periods
  - name: Payroll Liability Adjustments
  - name: Payroll Liability Checks
  - name: Payroll Prior Payments
  - name: Payroll Summary Reports
  - name: Payroll Year To Date Adjustments
  - name: Preferences
  - name: Price Levels
  - name: Purchase Orders
  - name: Qb Command Exec
  - name: Receive Payment To Deposits
  - name: Receive Payments
  - name: Sales Orders
  - name: Sales Receipts
  - name: Sales Reps
  - name: Sales Tax Codes
  - name: Sales Tax Payables
  - name: Sales Tax Payment Checks
  - name: Sales Tax Return Lines
  - name: Sales Tax Returns
  - name: Ship Methods
  - name: Special Accounts
  - name: Special Items
  - name: Standard Terms
  - name: Templates
  - name: Terms
  - name: Time Reports
  - name: Time Trackings
  - name: To Dos
  - name: Transactions
  - name: Transfer Inventories
  - name: Transfers
  - name: Txn Deleteds
  - name: Txn Displays
  - name: Txn Void
  - name: Txns
  - name: Unit Of Measure Sets
  - name: Vehicle Mileages
  - name: Vehicles
  - name: Vendor Credits
  - name: Vendor Types
  - name: Vendors
  - name: Workers Comp Codes
paths:
  /connections/{connection_id}/budget-summary-reports:
    get:
      tags:
        - Budget Summary Reports
      summary: List budget summary reports
      description: >-
        qbXML: `BudgetSummaryReportQueryRq`, from qbXML 3.0.


        Generates budget reports similar to the budget report functionality that
        is available within the QuickBooks UI. (From the main QB menubar select
        Reports->Budgets & Forecasts.) Note: the graphing functionality,
        forecasts, and memorized reports that available through the UI aren’t
        supported by the SDK. Notice that if you simply use the default instead
        of specifying the Fiscal Year, the `report_period` defaults to “year to
        date.” You can’t change the default to “This Fiscal Year.”


        There can only be one balance sheet budget for each fiscal year, one
        profit and loss (P&L) by account budget per fiscal year, and one profit
        and loss (P&L) by account and customer budget per fiscal year. Hence the
        `fiscal_year` element is key in specifying which budget you want. Notice
        that there are two “views” into each of the two budget categories: the
        Overview, which shows the budget itself, and the Actual, which shows how
        expenditures are currently running against the budget.


        All of the budget reports supported in the UI are supported in the SDK,
        although the UI and SDK nomenclature differs slightly. The UI shows
        Budget Overview and Budget Vs Actual as choices in the selection list,
        with Balance Sheet and P&L as subchoices in a subsequent selection list,
        already filtered by Accounts, or Accounts and Classes, or Accounts and
        Customers, if these are available.


        In comparison, you choose the budget view you want via the SDK
        BudgetSummaryType element, which has these possible values:


        - BalanceSheetBudgetOverview

        - BalanceSheetBudgetVsActual

        - ProfitAndLossBudgetOverview

        - ProfitAndLossBudgetVsActual


        Then you specify any additional filtering by the Budget Criterion value
        you specify (Accounts, AccountsAndCustomers, or AccountsAndClasses).
        Notice that before you can obtain a Budget report, the “target” budget
        must be defined in QuickBooks, via the UI, because you can’t create a
        budget via the SDK.


        Intuit's reference:
        [BudgetSummaryReportQuery](https://developer.intuit.com/app/developer/qbdesktop/docs/api-reference/qbdesktop/budgetsummaryreportquery).
      operationId: listBudgetSummaryReports
      parameters:
        - description: >-
            The connection (a customer's QuickBooks company file) this request
            is queued for.
          in: path
          name: connection_id
          required: true
          schema:
            format: uuid
            type: string
        - description: >-
            Your own label for the request, sent to QuickBooks as its qbXML
            `requestID` and echoed in the raw answer (`response_xml`); optional,
            since the answer's webhook already carries the request's `id`.
          in: query
          name: request_id
          required: false
          schema:
            type: string
        - description: What this budget covers.
          in: query
          name: budget_criterion
          required: false
          schema:
            enum:
              - Accounts
              - AccountsAndClasses
              - AccountsAndCustomers
            type: string
        - description: The type of budget report being queried.
          in: query
          name: budget_summary_report_type
          required: true
          schema:
            enum:
              - BalanceSheetBudgetOverview
              - BalanceSheetBudgetVsActual
              - ProfitAndLossBudgetOverview
              - ProfitAndLossBudgetPerformance
              - ProfitAndLossBudgetVsActual
            type: string
        - description: >-
            Set `display_report` to true to display this report within the
            QuickBooks UI. (Default is false.) If you want the request to
            display the report without returning any data to your application,
            set the responseData attribute to includeNone.
          in: query
          name: display_report
          required: false
          schema:
            type: boolean
        - description: >-
            Specify the fiscal year of the budget to be queried. There can only
            be one balance sheet budget for each fiscal year, one profit and
            loss (P&L) by account budget per fiscal year, and one profit and
            loss (P&L) by account and customer budget per fiscal year. When
            Fiscal year isn’t the current year, the report returns the data for
            the full fiscal year.
          in: query
          name: fiscal_year
          required: true
          schema:
            type: integer
        - description: >-
            Allows you to query for a specified class. Classes can be used to
            separate transactions into meaningful categories. (For example,
            transactions could be classified according to department, business
            location, or type of work.) In QuickBooks, class tracking is off by
            default.
          in: query
          name: report_class_filter
          required: false
          schema:
            oneOf:
              - properties:
                  list_id:
                    items:
                      type: string
                    type: array
                required:
                  - list_id
                title: ListID
                type: object
              - properties:
                  full_name:
                    items:
                      type: string
                    type: array
                required:
                  - full_name
                title: FullName
                type: object
              - properties:
                  list_id_with_children:
                    description: >-
                      Allows you to filter for data that relates to the
                      specified object and its descendants.
                    type: string
                required:
                  - list_id_with_children
                title: ListIDWithChildren
                type: object
              - properties:
                  full_name_with_children:
                    description: >-
                      Allows you to filter for data that relates to the
                      specified object and its descendants. For names that don’t
                      have children, `full_name_with_children` is exactly the
                      same as `full_name`.
                    type: string
                required:
                  - full_name_with_children
                title: FullNameWithChildren
                type: object
            type: object
        - description: |-
            The time period covered by this report.

            Choose at most one of: `report_period`, or `report_date_macro`.
          in: query
          name: report_date_macro
          required: false
          schema:
            enum:
              - All
              - LastMonth
              - LastMonthToDate
              - LastQuarter
              - LastQuarterToDate
              - LastWeek
              - LastWeekToDate
              - LastYear
              - LastYearToDate
              - NextFourWeeks
              - NextMonth
              - NextQuarter
              - NextWeek
              - NextYear
              - ThisMonth
              - ThisMonthToDate
              - ThisQuarter
              - ThisQuarterToDate
              - ThisWeek
              - ThisWeekToDate
              - ThisYear
              - ThisYearToDate
              - Today
              - Yesterday
            type: string
        - description: >-
            If you omit both `to_report_date` and `from_report_date`, the report
            will cover the current fiscal year to date.


            Choose at most one of: `report_period`, or `report_date_macro`.
          in: query
          name: report_period
          required: false
          schema:
            properties:
              from_report_date:
                description: >-
                  Selects information from this date and later. The range of
                  acceptable `from_report_date` and `to_report_date` values
                  depends on how the report dates are determined. If the report
                  dates are based on the dates of transactions, the range is
                  01/01/1901 to 12/31/9999.
                format: date
                type: string
              to_report_date:
                description: >-
                  Selects information created on this date or earlier. The range
                  of acceptable `to_report_date` and `from_report_date` values
                  depends on how the report dates are determined. If the report
                  dates are based on the dates of transactions, the range is
                  01/01/1901 to 12/31/9999.
                format: date
                type: string
            type: object
        - description: >-
            `summarize_budget_columns_by` determines which data the report
            calculates and how the columns will be labeled across the top of the
            report.
          in: query
          name: summarize_budget_columns_by
          required: false
          schema:
            enum:
              - Class
              - Customer
              - Date
            type: string
        - description: >-
            How you want rows to be labeled in the report. For example, if you
            set the value to sbrbAccount, the report’s row labels might be
            “Checking,” “Savings,” and so on.
          in: query
          name: summarize_budget_rows_by
          required: false
          schema:
            enum:
              - Account
              - Class
              - Customer
            type: string
        - description: >-
            Where QuBe Sync POSTs the answered request (this same document with
            `response_json` filled in), signed with `X-QUBE-Signature`. Send one
            with every request: it is how answers are delivered. Optional only
            so a script can queue and look up `links.self` by hand. It must be
            an absolute http or https URL. It may not contain a username or
            password, and in production it may not point at localhost or a
            private, loopback or link-local address. A `qube listen` URL must be
            one of this app's.
          in: query
          name: webhook_url
          required: false
          schema:
            format: uri
            maxLength: 2048
            type: string
        - $ref: '#/components/parameters/IdempotencyKey'
      responses:
        '201':
          content:
            application/json:
              schema:
                properties:
                  data:
                    allOf:
                      - $ref: '#/components/schemas/QueuedRequest'
                      - properties:
                          response_json:
                            anyOf:
                              - $ref: >-
                                  #/components/schemas/listBudgetSummaryReports_response_json
                              - type: 'null'
                            description: '`null` until answered.'
                        type: object
                required:
                  - data
                type: object
          description: >-
            Queued for the connection's Web Connector. Pass `webhook_url` and
            QuBe Sync POSTs the answer to it once QuickBooks has answered (see
            the `answered` callback: its own payload, not this document).
            `links.self` returns this document on demand, with `response_json`
            filled in.
          headers:
            Idempotent-Replayed:
              $ref: '#/components/headers/IdempotentReplayed'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/SandboxPaused'
        '404':
          $ref: '#/components/responses/NotFound'
        '422':
          $ref: '#/components/responses/UnprocessableEntity'
      callbacks:
        answered:
          '{$request.query.webhook_url}':
            post:
              description: >
                Verify `X-QUBE-Signature`, answer 2xx within 5 seconds, then
                branch on `state`:


                * `response_received` -- QuickBooks accepted it: `response_json`
                is `status: "success"` with `data`, or, when there is nothing to
                show, QuickBooks' `message` (a query that matched nothing is a
                success, not an error). When QuickBooks carried it out but
                warned about something, `response_json.warning` has its `code`
                and `message`: `530`, for one, means a field you sent is not
                supported by the customer's QuickBooks and was not saved.

                * `error` -- it is over, and QuBe Sync won't try again. With
                `error.error_type` `quickbooks_business_error`, QuickBooks
                refused the request: `response_json` is `status: "error"`, and
                `response_json.error.code` is the status code to branch on. A
                `3200` (`stale_edit_sequence`: the record changed after you read
                it) usually comes with the record as it stands in
                `response_json.error.current`, its current `edit_sequence`
                included. Compare it with what you read first: when nobody else
                changed a field your update sets, re-apply your change and send
                it again with that `edit_sequence`; when someone did, ask your
                user which value wins rather than overwriting theirs (without
                `current`, query the record first). Otherwise QuickBooks never
                answered it: `xml_error` (the request itself was rejected, and
                will be again as sent), `outcome_unknown` (a write the Web
                Connector answered with an error in place of QuickBooks' answer:
                it may have been applied, so look in QuickBooks before sending
                it again) or `unexpected_error` (the Web Connector's log says
                more; a query can be sent again). A connection problem never
                ends here; it is `retryable`, below.

                * `retryable` -- the Web Connector could not get it into
                QuickBooks (QuickBooks was not running, the company file was not
                open or not this connection's, or a window in QuickBooks was in
                the way), so nothing was applied. QuBe Sync keeps trying on the
                Web Connector's runs, so don't resend: show the customer
                `error.user_message` so they can fix it. This webhook comes when
                the error first appears or changes, not on every try. If you no
                longer want the request, discard it (`POST
                /connections/{connection_id}/queued-requests/{id}/discard`).

                * `timed_out` -- no answer came back: the customer's computer
                lost its connection, or QuickBooks or the Web Connector was
                closed, while QuickBooks had the request. QuickBooks may still
                have applied it, so look before sending it again.
                `error.error_type` is `timed_out`.

                * `discarded` -- your app discarded it before the Web Connector
                picked it up. QuickBooks never got it, so nothing was applied.
                `error.error_type` is `discarded`, unless it was `retryable`
                when you discarded it: then `error` is still the connection
                error that held it up.


                An iterated query sends one webhook per page, all with the same
                `id` and each with its own `page_request_id` and `page`;
                `iteration_state` is `done` on the last page, which can arrive
                before earlier ones, so the import is complete once every page
                from 1 to the `done` page's `page` has been handled. Deliveries
                can arrive out of order and, after a retry, more than once: key
                on `page_request_id` plus `state`. A `retryable` webhook is not
                final: the answer that follows carries the same `id` and
                `page_request_id` with a different `state`, and only a repeat of
                the same `state` is a duplicate. A body that would be over 1 MB
                comes without `response_xml`: `response_xml_omitted` is true,
                and `links.self` is where to GET it; `response_json` is always
                there.


                If webhooks stop arriving altogether, the Web Connector on the
                customer's PC has most likely stopped calling in; requests wait
                until it does. Intuit's guide to its errors:
                https://quickbooks.intuit.com/learn-support/en-us/help-article/open-programs/fix-common-web-connector-errors-quickbooks-desktop/L9slolvg0_US_en_US
              requestBody:
                content:
                  application/json:
                    schema:
                      description: >-
                        POSTed to `webhook_url` as JSON, signed with
                        `X-QUBE-Signature` (`t=<timestamp>,v1=<hex HMAC-SHA256
                        of "<timestamp>.<raw body>" with your app's webhook
                        secret>`).
                      properties:
                        app_id:
                          description: Your app's id.
                          format: uuid
                          type: string
                        app_name:
                          type: string
                        error:
                          description: >-
                            Set when `state` is `error`, `retryable`,
                            `timed_out` or `discarded`. `error_type` says where
                            it failed: for a `timed_out` request it is
                            `timed_out`, and for a `discarded` one `discarded`,
                            unless the request was `retryable` when your app
                            discarded it, which keeps the connection error that
                            held it up. `user_message` is safe to show an end
                            user; `error_code` is QuickBooks' own status code
                            for a business error, `hresult` the Web Connector's
                            for a connection/XML error; `debug_message` is for
                            you.
                          properties:
                            debug_message:
                              description: >-
                                Which element of the request the value came
                                from, when known.
                              type:
                                - string
                                - 'null'
                            error_code:
                              description: QuickBooks' statusCode, for a business error.
                              type:
                                - integer
                                - 'null'
                            error_type:
                              description: >-
                                `quickbooks_business_error`: QuickBooks refused
                                the request -- `response_json.error` has its
                                code. `quickbooks_connection_error`: the Web
                                Connector ran on the customer's PC but could not
                                get the request into QuickBooks, so nothing was
                                applied -- QuickBooks was not running, the
                                company file was not open or not the one this
                                connection belongs to, or a window or message
                                box open in QuickBooks was in the way. Only the
                                customer can fix that, and `user_message` tells
                                them how. `xml_error`: QuickBooks could not
                                parse the qbXML; sent again as-is, it fails
                                again. `outcome_unknown`: a write the Web
                                Connector answered with an error in place of
                                QuickBooks' answer, so whether QuickBooks
                                applied it is not known: look in QuickBooks
                                before sending it again. `unexpected_error`:
                                anything else; for a query, which changes
                                nothing, sending it again is safe.


                                `timed_out`: no answer came back -- the
                                customer's computer lost its connection, or
                                QuickBooks or the Web Connector was closed,
                                while QuickBooks had the request. QuickBooks may
                                still have applied it, so look before sending it
                                again. `discarded`: your app discarded it before
                                the Web Connector picked it up, so QuickBooks
                                never got it. `response_too_large`: QuickBooks
                                answered, but with more than QuBe Sync accepts
                                for one answer (4 MB as the Web Connector sends
                                it, about 3 MB of qbXML), so the answer wasn't
                                kept and `response_json` is null. QuickBooks ran
                                the request. Page the query (`iterator` and a
                                smaller `max_returned`), or narrow it when
                                QuickBooks doesn't page it; for a write, look
                                before sending it again.


                                Web Connector problems on the customer's PC (its
                                password, log file, the .QWC file) never reach
                                QuBe Sync as an error: the Web Connector just
                                stops calling in, and requests wait. Intuit's
                                guide for those:
                                https://quickbooks.intuit.com/learn-support/en-us/help-article/open-programs/fix-common-web-connector-errors-quickbooks-desktop/L9slolvg0_US_en_US
                              enum:
                                - xml_error
                                - quickbooks_connection_error
                                - quickbooks_business_error
                                - unexpected_error
                                - response_too_large
                                - outcome_unknown
                                - timed_out
                                - discarded
                              type: string
                            hresult:
                              description: >-
                                The Web Connector's HRESULT (e.g. `0x80040400`),
                                for a connection or XML error. Informational:
                                branch on `error_type`, not on this.
                              type:
                                - string
                                - 'null'
                            message:
                              description: >-
                                The raw message from QuickBooks or the Web
                                Connector; for `timed_out` and `discarded`,
                                which neither sent, QuBe Sync's own.
                              type: string
                            user_message:
                              description: A friendly message for the end user.
                              type: string
                          type:
                            - object
                            - 'null'
                        id:
                          description: >-
                            The request's id, as the 201 returned it. For an
                            iterated query, every page carries the first page's
                            id here.
                          format: uuid
                          type: string
                        iteration_state:
                          description: >-
                            `continue`: more pages will follow, each its own
                            webhook. `done`: this was the last page.
                            `max_sandbox_iterations_reached`: a sandbox app's
                            page limit stopped the iteration.
                          enum:
                            - not_applicable
                            - continue
                            - done
                            - max_sandbox_iterations_reached
                          type: string
                        links:
                          description: Present only with `response_xml_omitted`.
                          properties:
                            self:
                              description: >-
                                This page's request in the API, `response_xml`
                                included.
                              format: uri
                              type: string
                          type: object
                        page:
                          description: The page number, when iterated.
                          type:
                            - integer
                            - 'null'
                        page_request_id:
                          description: >-
                            This page's own id. Equal to `id` except on later
                            pages of an iterated query.
                          format: uuid
                          type: string
                        response_json:
                          $ref: >-
                            #/components/schemas/listBudgetSummaryReports_response_json
                        response_xml:
                          description: >-
                            QuickBooks' raw qbXML answer. `response_json` is the
                            same, summarized. One answer can be at most 4 MB as
                            the Web Connector sends it, about 3 MB of qbXML;
                            QuickBooks' answer over that isn't kept: this is
                            null and `error.error_type` is `response_too_large`.
                            A webhook whose body would be over 1 MB is sent
                            without it: null, with `response_xml_omitted` true;
                            fetch it from `links.self`.
                          type:
                            - string
                            - 'null'
                        response_xml_omitted:
                          description: >-
                            Present, and true, only when `response_xml` was left
                            out to keep the body under 1 MB. `response_json` is
                            still here; GET `links.self` for `response_xml`.
                          type: boolean
                        sandbox:
                          description: Whether the app is a sandbox app.
                          type: boolean
                        state:
                          description: >-
                            `response_received`: QuickBooks accepted it; read
                            `response_json`. `error`: it is over and QuBe Sync
                            won't try again -- see `error`, and
                            `response_json.error` for a QuickBooks business
                            error; with `error_type` `outcome_unknown` a write
                            may still have been applied, so look before sending
                            it again. `retryable`: QuickBooks could not be
                            reached and QuBe Sync keeps trying; show the
                            customer `error.user_message` so they can fix it.
                            `timed_out`: no answer came back -- the customer's
                            computer lost its connection, or QuickBooks or the
                            Web Connector was closed, mid-request. QuickBooks
                            may still have applied it, so look before sending it
                            again. `discarded`: your app discarded it before the
                            Web Connector picked it up, so QuickBooks never got
                            it. Both carry an `error`.
                          enum:
                            - response_received
                            - error
                            - retryable
                            - timed_out
                            - discarded
                          type: string
                        timestamp:
                          description: Unix seconds; the same `t` the signature covers.
                          type: integer
                      required:
                        - app_id
                        - app_name
                        - sandbox
                        - timestamp
                        - id
                        - page_request_id
                        - state
                        - response_json
                        - error
                      type: object
                required: true
              responses:
                2XX:
                  description: >-
                    Received. Anything else is retried with backoff for about 8
                    hours.
              summary: QuickBooks answered (or the request failed)
              method: post
              type: path
            path: '{$request.query.webhook_url}'
components:
  parameters:
    IdempotencyKey:
      description: >-
        Makes a retry safe when you never got the answer to a call: a timeout, a
        dropped connection, a worker that crashed. Send a new key (a UUID, say)
        with each request you mean to make once, and the same key when you send
        that request again. A repeat with the key and the same method, path,
        query and body answers `201` with what the first call created, as it is
        now, marked `Idempotent-Replayed: true`, and queues nothing. The same
        key with a different request is a `422`. A key belongs to your app
        (sandbox and production apps never share one), lasts as long as what it
        created, and is 1 to 255 printable ASCII characters.
      example: 9b2f6c1e-0d4a-4f7e-8a7b-2a1c3d4e5f60
      in: header
      name: Idempotency-Key
      required: false
      schema:
        maxLength: 255
        minLength: 1
        pattern: ^[\x20-\x7E]+$
        type: string
  schemas:
    QueuedRequest:
      properties:
        error:
          description: >-
            Set when `state` is `error`, `retryable`, `timed_out` or
            `discarded`. `error_type` says where it failed: for a `timed_out`
            request it is `timed_out`, and for a `discarded` one `discarded`,
            unless the request was `retryable` when your app discarded it, which
            keeps the connection error that held it up. `user_message` is safe
            to show an end user; `error_code` is QuickBooks' own status code for
            a business error, `hresult` the Web Connector's for a connection/XML
            error; `debug_message` is for you.
          properties:
            debug_message:
              description: Which element of the request the value came from, when known.
              type:
                - string
                - 'null'
            error_code:
              description: QuickBooks' statusCode, for a business error.
              type:
                - integer
                - 'null'
            error_type:
              description: >-
                `quickbooks_business_error`: QuickBooks refused the request --
                `response_json.error` has its code.
                `quickbooks_connection_error`: the Web Connector ran on the
                customer's PC but could not get the request into QuickBooks, so
                nothing was applied -- QuickBooks was not running, the company
                file was not open or not the one this connection belongs to, or
                a window or message box open in QuickBooks was in the way. Only
                the customer can fix that, and `user_message` tells them how.
                `xml_error`: QuickBooks could not parse the qbXML; sent again
                as-is, it fails again. `outcome_unknown`: a write the Web
                Connector answered with an error in place of QuickBooks' answer,
                so whether QuickBooks applied it is not known: look in
                QuickBooks before sending it again. `unexpected_error`: anything
                else; for a query, which changes nothing, sending it again is
                safe.


                `timed_out`: no answer came back -- the customer's computer lost
                its connection, or QuickBooks or the Web Connector was closed,
                while QuickBooks had the request. QuickBooks may still have
                applied it, so look before sending it again. `discarded`: your
                app discarded it before the Web Connector picked it up, so
                QuickBooks never got it. `response_too_large`: QuickBooks
                answered, but with more than QuBe Sync accepts for one answer (4
                MB as the Web Connector sends it, about 3 MB of qbXML), so the
                answer wasn't kept and `response_json` is null. QuickBooks ran
                the request. Page the query (`iterator` and a smaller
                `max_returned`), or narrow it when QuickBooks doesn't page it;
                for a write, look before sending it again.


                Web Connector problems on the customer's PC (its password, log
                file, the .QWC file) never reach QuBe Sync as an error: the Web
                Connector just stops calling in, and requests wait. Intuit's
                guide for those:
                https://quickbooks.intuit.com/learn-support/en-us/help-article/open-programs/fix-common-web-connector-errors-quickbooks-desktop/L9slolvg0_US_en_US
              enum:
                - xml_error
                - quickbooks_connection_error
                - quickbooks_business_error
                - unexpected_error
                - response_too_large
                - outcome_unknown
                - timed_out
                - discarded
              type: string
            hresult:
              description: >-
                The Web Connector's HRESULT (e.g. `0x80040400`), for a
                connection or XML error. Informational: branch on `error_type`,
                not on this.
              type:
                - string
                - 'null'
            message:
              description: >-
                The raw message from QuickBooks or the Web Connector; for
                `timed_out` and `discarded`, which neither sent, QuBe Sync's
                own.
              type: string
            user_message:
              description: A friendly message for the end user.
              type: string
          type:
            - object
            - 'null'
        id:
          description: Unique identifier for the queued request
          format: uuid
          type: string
        inserted_at:
          description: When the request was queued
          format: date-time
          type: string
        iteration_state:
          description: >-
            Whether this response is part of an ongoing iteration, and if so,
            whether more pages remain. Use this (not `state`) to tell whether a
            multi-page response is complete.
          enum:
            - not_applicable
            - continue
            - done
            - max_sandbox_iterations_reached
          type: string
        links:
          properties:
            connection_ui:
              format: uri
              type: string
            pages:
              description: >-
                The pages of a multi-page (iterated) response answered so far,
                oldest first, a page of them at a time (`page`, `page_size`),
                each with its own `iteration_state`. Each page is also delivered
                to `webhook_url` as it is answered.
              format: uri
              type: string
            self:
              description: >-
                This request, on demand (a dashboard link, a retry). The answer
                itself arrives at `webhook_url`.
              format: uri
              type: string
            ui:
              description: The request in the QuBe Sync dashboard.
              format: uri
              type: string
          required:
            - self
            - ui
            - connection_ui
            - pages
          type: object
        original_request_id:
          description: >-
            The id of the first page of this request's iteration. Equal to `id`
            on the first page itself.
          format: uuid
          type: string
        page:
          description: The page number, for a multi-page (iterated) response
          nullable: true
          type: integer
        request_types:
          description: The qbXML request type(s) compiled into this request
          items:
            type: string
          type: array
        request_xml:
          description: >-
            The qbXML sent to QuickBooks: compiled from the operation and its
            parameters, or as written for `POST
            /connections/{connection_id}/queued-requests`. A character above
            ASCII reaches QuickBooks as a character reference (`&#xE9;`).
          type: string
        response_json:
          description: QuBe Sync's summary of the answer, once the request is completed
          nullable: true
          type: object
        response_xml:
          description: >-
            The qbXML response from QuickBooks. One answer can be at most 4 MB
            as the Web Connector sends it, about 3 MB of qbXML; QuickBooks'
            answer over that isn't kept: this is null and `error.error_type` is
            `response_too_large`.
          nullable: true
          type: string
        state:
          description: >-
            `waiting`/`retryable`/`ticketed`/`sent` while the Web Connector is
            on its way; `response_received` once QuickBooks answered
            successfully (read `response_json.data`, and `response_json.warning`
            when QuickBooks warned about something it did); `error` when it did
            not -- the Web Connector could not reach QuickBooks, the qbXML was
            rejected, or QuickBooks answered with a business error such as 3100
            (then `error.error_type` is `quickbooks_business_error` and
            `response_json` still carries QuickBooks' own `{status: "error",
            error: {code, type, message}}`); `timed_out` when no answer came
            back (QuickBooks may still have applied it, so look before sending
            it again) and `discarded` when your app discarded it before the Web
            Connector picked it up. Both carry an `error`.
          enum:
            - waiting
            - retryable
            - ticketed
            - sent
            - response_received
            - error
            - timed_out
            - discarded
          type: string
        webhook_attempts:
          items:
            type: object
          type: array
        webhook_error:
          nullable: true
          type: string
        webhook_state:
          enum:
            - not_applicable
            - pending
            - succeeded
            - failed
          type: string
        webhook_url:
          format: uri
          nullable: true
          type: string
      required:
        - id
        - state
        - request_xml
        - links
      type: object
    listBudgetSummaryReports_response_json:
      description: >-
        QuBe Sync's summary of QuickBooks' answer. Only an `Error` severity from
        QuickBooks is `status: "error"` (and makes the request's `state`
        `error`), so a query that matched nothing is still `success`. A `Warn`
        severity is a `success` with `warning` beside it.
      oneOf:
        - properties:
            data:
              properties:
                col_desc:
                  items:
                    properties:
                      col_id:
                        description: >-
                          An identifying number that corresponds to the position
                          of this column in the report. The columns are numbered
                          from left to right, starting with 1.
                        type: integer
                      col_title:
                        items:
                          type: string
                        type: array
                      col_type:
                        description: >-
                          The type of data that this column contains. `col_type`
                          values are formatted types. (Returned ctPercent
                          values, for example, will have digits after the
                          decimal points, and ctAddr1 values will be strings.)
                        enum:
                          - Account
                          - Addr1
                          - Addr2
                          - Addr3
                          - Addr4
                          - Addr5
                          - Aging
                          - Amount
                          - AmountDifference
                          - AverageCost
                          - BilledDate
                          - BillingStatus
                          - Blank
                          - CalculatedAmount
                          - Class
                          - ClearedStatus
                          - CostPrice
                          - CreateDate
                          - Credit
                          - CustomField
                          - Date
                          - Debit
                          - DeliveryDate
                          - DueDate
                          - Duration
                          - EarliestReceiptDate
                          - EstimateActive
                          - FOB
                          - IncomeSubjectToTax
                          - Invoiced
                          - IsAdjustment
                          - Item
                          - ItemDesc
                          - ItemVendor
                          - Label
                          - LastModifiedBy
                          - LatestOrPriorState
                          - Memo
                          - ModifiedTime
                          - Name
                          - NameAccountNumber
                          - NameAddress
                          - NameCity
                          - NameContact
                          - NameEmail
                          - NameFax
                          - NamePhone
                          - NameState
                          - NameZip
                          - OpenBalance
                          - OriginalAmount
                          - PONumber
                          - PaidAmount
                          - PaidStatus
                          - PaidThroughDate
                          - PaymentMethod
                          - PayrollItem
                          - Percent
                          - PercentChange
                          - PercentOfTotalRetail
                          - PercentOfTotalValue
                          - PhysicalCount
                          - PrintStatus
                          - ProgressAmount
                          - ProgressPercent
                          - Quantity
                          - QuantityAvailable
                          - QuantityOnHand
                          - QuantityOnOrder
                          - QuantityOnPendingBuild
                          - QuantityOnSalesOrder
                          - ReceivedQuantity
                          - RefNumber
                          - ReorderPoint
                          - RetailValueOnHand
                          - RunningBalance
                          - SONumber
                          - SSNOrTaxID
                          - SalesPerWeek
                          - SalesRep
                          - SalesTaxCode
                          - ShipDate
                          - ShipMethod
                          - ShipToAddr1
                          - ShipToAddr2
                          - ShipToAddr3
                          - ShipToAddr4
                          - ShipToAddr5
                          - SourceName
                          - SplitAccount
                          - SuggestedReorder
                          - TaxLine
                          - TaxTableVersion
                          - Terms
                          - Total
                          - TxnID
                          - TxnNumber
                          - TxnType
                          - UnitPrice
                          - UserEdit
                          - ValueOnHand
                          - WageBase
                          - WageBaseTips
                        type: string
                      data_type:
                        description: 'The data type: IDTYPE, STRTYPE, and so on.'
                        enum:
                          - AMTTYPE
                          - BOOLTYPE
                          - DATETIMETYPE
                          - DATETYPE
                          - ENUMTYPE
                          - GUIDTYPE
                          - IDTYPE
                          - INTTYPE
                          - PERCENTTYPE
                          - PRICETYPE
                          - QUANTYPE
                          - STRTYPE
                          - TIMEINTERVALTYPE
                        type: string
                    type: object
                  type: array
                num_col_title_rows:
                  description: >-
                    The number of rows to allocate for column titles. Although
                    this number is usually 1, with some reports it is 2 or 3.
                    (For an example of column titles that span multiple rows,
                    look at a ProfitAndLossByJob report in QuickBooks.)
                  type: integer
                num_columns:
                  description: The number of columns in the report.
                  type: integer
                num_rows:
                  description: The number of rows in the report.
                  type: integer
                report_basis:
                  description: >-
                    If `report_basis` is rbCash, the report bases income and
                    expenses on the dates when money changed hands.rbAccrual,
                    the report bases income on the dates when customers were
                    invoiced and bases expenses on the dates when bills were
                    entered.rbNone, the report uses the default `report_basis`,
                    which is either the QuickBooks Preference setting or the
                    QuickBooks default for a given type of report.
                  enum:
                    - Accrual
                    - Cash
                    - None
                  type: string
                report_data:
                  description: >-
                    If the report contains any data, it is given row-by-row in a
                    `report_data` aggregate.
                  properties:
                    data_row:
                      description: >-
                        A data row contains the actual data for each column.


                        `data_row`, `text_row`, `subtotal_row` and `total_row`
                        combine: any number of each.
                      items:
                        properties:
                          col_data:
                            items:
                              type: string
                            type: array
                          row_data:
                            description: '`row_data` describes one row in the report.'
                            type: string
                          row_number:
                            description: >-
                              The row number. Rows are numbered from top to
                              bottom, starting with 1.
                            type: integer
                        type: object
                      type: array
                    subtotal_row:
                      description: >-
                        A row that contains a calculated subtotal of the data in
                        all the rows since the last SubTotalRow and, usually, a
                        single underline. There can be multiple SubTotalRow
                        aggregates in a report.


                        `data_row`, `text_row`, `subtotal_row` and `total_row`
                        combine: any number of each.
                      items:
                        properties:
                          col_data:
                            items:
                              type: string
                            type: array
                          row_data:
                            description: '`row_data` describes one row in the report.'
                            type: string
                          row_number:
                            description: >-
                              The row number. Rows are numbered from top to
                              bottom, starting with 1.
                            type: integer
                        type: object
                      type: array
                    text_row:
                      description: >-
                        A text row contains only text and is used mainly for
                        headings.


                        `data_row`, `text_row`, `subtotal_row` and `total_row`
                        combine: any number of each.
                      items:
                        type: string
                      type: array
                    total_row:
                      description: >-
                        A row that contains a calculated total of all the data
                        that has come before and a double underline. There will
                        only be one `total_row` per report. If `total_row`
                        doesn’t include any numerical values, the columns
                        required to show the total values aren’t part of the
                        report. These columns weren’t included when the report
                        was customized.


                        `data_row`, `text_row`, `subtotal_row` and `total_row`
                        combine: any number of each.
                      items:
                        properties:
                          col_data:
                            items:
                              type: string
                            type: array
                          row_data:
                            description: '`row_data` describes one row in the report.'
                            type: string
                          row_number:
                            description: >-
                              The row number. Rows are numbered from top to
                              bottom, starting with 1.
                            type: integer
                        type: object
                      type: array
                  type: object
                report_subtitle:
                  description: The subtitle for this report.
                  type: string
                report_title:
                  description: The main title for this report.
                  type: string
              type: object
            message:
              description: >-
                QuickBooks' own status message, carried through when there is no
                data to show for an otherwise successful request (a query that
                matched nothing, say).


                * `no_match` (1): The query ran and matched nothing.

                * `not_found_by_key` (500): A record was looked up by an exact
                key (a FullName or ListID) and does not exist.


                What each means and how to handle it: [Error
                handling](https://docs.qubesync.com/error_handling#quickbooks-said-no).
              type: string
            status:
              const: success
            warning:
              description: >-
                Present only when QuickBooks answered with a `Warn` severity: it
                carried the request out, and `data` is what it saved or found,
                but it has something to say about it. For example code `530`
                with the message `The field "Memo" is not supported by this
                implementation.` means the record was saved without that field,
                so an add or update that comes back with a `warning` may not
                have saved everything it sent. Absent on a plain success and on
                an error.
              properties:
                code:
                  description: >-
                    QuickBooks' own statusCode. The stable thing to branch on.


                    * `not_found_by_key` (500): A record was looked up by an
                    exact key (a FullName or ListID) and does not exist.


                    What each means and how to handle it: [Error
                    handling](https://docs.qubesync.com/error_handling#quickbooks-said-yes-with-a-warning).
                  examples:
                    - 500
                  type: integer
                message:
                  description: >-
                    QuickBooks' own statusMessage, such as which field it did
                    not support.
                  type: string
              required:
                - code
              type: object
          required:
            - status
          title: Success
          type: object
        - properties:
            error:
              properties:
                code:
                  description: QuickBooks' own statusCode. The stable thing to branch on.
                  examples:
                    - 1030
                    - 3150
                    - 3210
                    - 3220
                    - 3250
                    - 3260
                  type:
                    - integer
                    - 'null'
                message:
                  description: QuickBooks' own statusMessage.
                  type: string
                type:
                  description: >-
                    A stable name for `code`, when QuBeSync recognises it.
                    Absent otherwise: coverage widens over time, so treat this
                    as a hint and branch on `code` if you need certainty.


                    * `unsupported_request` (1030): The QuickBooks this
                    connection talks to does not support this request.

                    * `missing_element` (3150): QuickBooks requires an element
                    the request left out; the message names it.

                    * `invalid_value` (3210): A field's value is not one
                    QuickBooks accepts; the message names the field and the
                    value.

                    * `not_authorized` (3220): QuickBooks refused the request:
                    no permission for it, or the feature is turned off in this
                    company file.

                    * `feature_not_enabled` (3250): The feature is turned off in
                    this company file, or this edition of QuickBooks does not
                    have it.

                    * `insufficient_permission` (3260): The permission level
                    QuickBooks granted does not allow this action.


                    What each means and how to handle it: [Error
                    handling](https://docs.qubesync.com/error_handling#quickbooks-said-no).
                  enum:
                    - unsupported_request
                    - missing_element
                    - invalid_value
                    - not_authorized
                    - feature_not_enabled
                    - insufficient_permission
                  type: string
              type: object
            status:
              const: error
          required:
            - status
            - error
          title: Error
          type: object
    Error:
      description: >-
        What a refused request answers with. The one key is errors, and its
        shape says what went wrong: a sentence when the endpoint explains the
        refusal in words (a parameter the operation does not take, a key already
        taken, a run that has already ended); an object with detail, and a code
        when there is one, when the request named nothing that exists or may not
        do what it asked (402, 403, 404, and a CLI session's 401), or an answer
        to a run's question was refused (the decisions endpoint's 400, 409 and
        422, which always carry a code to branch on); an object of fields, each
        a list of messages, when a record failed validation and nothing was
        saved; a list of {path, message} problems when a submitted document or
        input fails validation. A request without a usable API key gets a 401
        Basic challenge with the plain-text body Unauthorized, not JSON.
      properties:
        errors:
          oneOf:
            - example: 'unknown parameter: "emial"'
              title: A sentence
              type: string
            - properties:
                code:
                  example: read_only_session
                  type: string
                detail:
                  example: Not Found
                  type: string
              required:
                - detail
              title: Detail and code
              type: object
            - additionalProperties:
                items:
                  type: string
                type: array
              example:
                webhook_url:
                  - may not contain a username or password
              title: Field by field
              type: object
            - items:
                properties:
                  message:
                    example: is required
                    type: string
                  path:
                    example: input.customer
                    type: string
                required:
                  - path
                  - message
                type: object
              title: Located problems
              type: array
      required:
        - errors
      type: object
  headers:
    IdempotentReplayed:
      description: >-
        `true` when the call repeated an earlier call's `Idempotency-Key`: this
        is what that call created, as it is now, and nothing new was queued.
        Absent otherwise.
      schema:
        enum:
          - 'true'
        type: string
  responses:
    BadRequest:
      content:
        application/json:
          example:
            errors: 'unknown parameter: "emial"'
          schema:
            $ref: '#/components/schemas/Error'
      description: >-
        A parameter the operation does not take, or a value it cannot use.
        Nothing was queued.
    Unauthorized:
      content:
        text/plain:
          example: Unauthorized
          schema:
            type: string
      description: >-
        No usable API key. The key is Basic auth, so the answer is the
        challenge, with the plain-text body Unauthorized rather than JSON.
      headers:
        WWW-Authenticate:
          schema:
            example: Basic realm="Application"
            type: string
    SandboxPaused:
      content:
        application/json:
          example:
            errors:
              detail: >-
                Sandbox access is paused for this organization because the
                sandbox period expired and the organization does not currently
                have both active billing and a recent production connection.
                Please request an extension if you're still working on your
                integration or contact support if you have questions.
          schema:
            $ref: '#/components/schemas/Error'
      description: >-
        A sandbox app whose organization's sandbox access is paused. Nothing was
        queued.
    NotFound:
      content:
        application/json:
          example:
            errors:
              detail: Not Found
          schema:
            $ref: '#/components/schemas/Error'
      description: Nothing by that id, or it belongs to another app.
    UnprocessableEntity:
      content:
        application/json:
          example:
            errors:
              webhook_url:
                - may not contain a username or password
          schema:
            $ref: '#/components/schemas/Error'
      description: >-
        A field failed validation, field by field, and nothing was queued: a
        `webhook_url` that is not an absolute http or https URL, carries a
        username or password, is longer than 2048 characters, or (in production)
        points at localhost or a private address. An `Idempotency-Key` that
        isn't 1 to 255 printable ASCII characters, or that was already used for
        a different request, is refused in a sentence naming the header.
  securitySchemes:
    apiKey:
      description: Use your app's API key as the username, and leave the password blank
      scheme: basic
      type: http

````

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