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

# Create a connection

> Creates a connection for the authenticated app. A `standard`/`realtime` connection needs onboarding (`links.onboarding`) before it can be used; a `simulated` one (beta) is usable immediately. Only `name`, `type` and `webhook_url` can be set. The rest of a connection's fields are QuBe Sync's: sending `username`, `password`, `company_file`, `quickbooks_product_name` or `last_connected_at` is refused with `422` naming the field. Set a password with `POST /connections/{connection_id}/password`.

A production app can have connections only once its organization has billing: until then every type, `simulated` included, is refused with `402 billing_required`. A sandbox app can always have them.

Pass a `webhook_url` to hear when the connection is set up: QuBe Sync sends `connection.connected` when the Web Connector first checks in, and `connection.setup_cancelled` if your customer cancels the setup. It also sends `connection.stalled` and `connection.resumed`: see the callback. v2 doesn't take a `redirect_url`, and sending one is refused with `422`: the connection's events say what the redirect did, signed and from QuBe Sync rather than from your customer's browser.



## OpenAPI

````yaml /api-reference/v2/openapi.json post /connections
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:
    post:
      tags:
        - Connections
      summary: Create a connection
      description: >-
        Creates a connection for the authenticated app. A `standard`/`realtime`
        connection needs onboarding (`links.onboarding`) before it can be used;
        a `simulated` one (beta) is usable immediately. Only `name`, `type` and
        `webhook_url` can be set. The rest of a connection's fields are QuBe
        Sync's: sending `username`, `password`, `company_file`,
        `quickbooks_product_name` or `last_connected_at` is refused with `422`
        naming the field. Set a password with `POST
        /connections/{connection_id}/password`.


        A production app can have connections only once its organization has
        billing: until then every type, `simulated` included, is refused with
        `402 billing_required`. A sandbox app can always have them.


        Pass a `webhook_url` to hear when the connection is set up: QuBe Sync
        sends `connection.connected` when the Web Connector first checks in, and
        `connection.setup_cancelled` if your customer cancels the setup. It also
        sends `connection.stalled` and `connection.resumed`: see the callback.
        v2 doesn't take a `redirect_url`, and sending one is refused with `422`:
        the connection's events say what the redirect did, signed and from QuBe
        Sync rather than from your customer's browser.
      operationId: createConnection
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              properties:
                name:
                  description: >-
                    Optional. A blank name (empty or only whitespace) is stored
                    as `null`, and surrounding whitespace is trimmed. Left
                    blank, a `standard` or `realtime` connection takes
                    QuickBooks' own company name once the first request is
                    processed; a `simulated` connection takes its simulated
                    company's name (`Simulated Company`) straight away.
                  type: string
                type:
                  default: standard
                  description: >-
                    Optional, `standard` by default. Create the connections your
                    integration runs workflows on as `realtime`: workflows run
                    on `realtime` and `simulated` connections only, and a
                    connection's type can't be changed through the API
                    afterwards (it can be upgraded from its page in the
                    dashboard).
                  enum:
                    - standard
                    - realtime
                    - simulated
                  type: string
                webhook_url:
                  description: >-
                    Optional. Where QuBe Sync sends the connection's own events,
                    signed like every webhook: `connection.connected` when the
                    Web Connector first checks in (and again after your customer
                    chooses Set up again), `connection.setup_cancelled`,
                    `connection.stalled` and `connection.resumed` (see the
                    callback on Create a connection). Point it at your own
                    record, such as `/webhooks/qube/connection/42` on your app.
                    Left out, nothing is sent. A `simulated` connection is
                    connected as it's created, so its `connection.connected`
                    goes out straight away. 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.
                  example: https://myapp.example/webhooks/qube/connection/42
                  format: uri
                  maxLength: 2048
                  type: string
              type: object
      responses:
        '201':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/Connection'
                type: object
          description: Created
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          content:
            application/json:
              examples:
                billing_required:
                  summary: A production app without billing
                  value:
                    errors:
                      code: billing_required
                      detail: >-
                        This is a production app, and its organization doesn't
                        have billing set up yet, so it can't have connections.
                        An owner of the organization can set up billing in the
                        QuBe Sync dashboard. To test before then, use the
                        organization's sandbox app.
              schema:
                $ref: '#/components/schemas/Error'
          description: >-
            `billing_required`: this is a production app, and its organization
            has no active billing yet. A production app can't have connections
            of any type, `simulated` included, until an owner of the
            organization sets up billing in the dashboard. Use the sandbox app
            to test before then. Nothing was saved.
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrors'
          description: >-
            Invalid fields, such as a `webhook_url` webhooks can't go to (not an
            absolute http or https URL, a username or password in it, longer
            than 2048 characters, or in production a private address), or a
            field that can't be set here, such as `redirect_url` or
            `last_connected_at`. `errors` names each one. Nothing was saved.
      callbacks:
        connection_events:
          '{$request.body#/webhook_url}':
            post:
              description: >-
                Sent to the connection's `webhook_url` (set here or by Update a
                connection), signed with `X-QUBE-Signature` like every other
                webhook (see the Webhooks guide). One of four events:


                - `connection.connected`: the Web Connector checked in for the
                first time, or for the first time since your customer chose Set
                up again on the connection's onboarding page (`connection.setup`
                says which). This is the signal to act on: mark the account
                connected. Your customer finishes the setup on the QuickBooks
                computer, which usually isn't signed in to your app, so your app
                hears it here rather than from their browser.

                - `connection.setup_cancelled`: your customer chose Cancel setup
                on the onboarding page. The connection is unchanged, and its
                onboarding link still works, so offer them Connect again.

                - `connection.stalled`: one of your requests has waited too long
                to be taken: past when the Web Connector was due to take it, by
                the longer of 15 minutes and twice the Web Connector's schedule.
                `connection.stall_reason` says why. `not_checking_in`: the Web
                Connector hasn't checked in when it was due, so the QuickBooks
                computer is probably off or offline. `quickbooks_unavailable`:
                the Web Connector is checking in but can't reach QuickBooks,
                usually because QuickBooks isn't open with the company file; the
                wait then counts from when your request was queued. If the
                reason changes while the stall goes on, the event comes again
                with the new reason and a newer `revision`. A connection with
                nothing of yours waiting is never stalled, and a simulated one
                only when its simulator's `stalled` fault is set, to test this
                handler.

                - `connection.resumed`: a stalled connection's requests aren't
                waiting past that any more: they were taken, answered or
                deleted, or the Web Connector is checking in again. Only ever
                after a `connection.stalled`.


                A delivery can come more than once, and deliveries can come out
                of order. Take each `delivery_id` once, and apply an event only
                when its `revision` is newer than the last you applied.
              requestBody:
                content:
                  application/json:
                    examples:
                      connected:
                        summary: The Web Connector checked in for the first time
                        value:
                          app_id: 98f339a4-32e8-424a-987e-ccaf5bcaa620
                          connection:
                            id: 3f9c2a71-5d4e-4b8a-9c1f-7e2d6a5b8c90
                            last_connected_at: '2026-10-18T19:04:11Z'
                            name: Riverbend Electric
                            setup: first
                            type: standard
                          delivery_id: 0f8a6c2e-4b1d-4e7a-9c3f-2d5b8e1a7c40
                          event: connection.connected
                          links:
                            self: >-
                              https://qubesync.com/api/v2/connections/3f9c2a71-5d4e-4b8a-9c1f-7e2d6a5b8c90
                          revision: 1
                          sandbox: false
                          timestamp: 1792350252
                      resumed:
                        summary: >-
                          The stalled connection's requests are being taken
                          again
                        value:
                          app_id: 98f339a4-32e8-424a-987e-ccaf5bcaa620
                          connection:
                            id: 3f9c2a71-5d4e-4b8a-9c1f-7e2d6a5b8c90
                            last_connected_at: '2026-10-20T09:41:08Z'
                            name: Riverbend Electric
                            stalled_at: '2026-10-20T08:30:00Z'
                            type: standard
                          delivery_id: c7e9a1b3-5d7f-4b9a-8c2e-4f6a8b0c2d57
                          event: connection.resumed
                          links:
                            self: >-
                              https://qubesync.com/api/v2/connections/3f9c2a71-5d4e-4b8a-9c1f-7e2d6a5b8c90
                          revision: 3
                          sandbox: false
                          timestamp: 1792489270
                      setup_cancelled:
                        summary: Your customer chose Cancel setup
                        value:
                          app_id: 98f339a4-32e8-424a-987e-ccaf5bcaa620
                          connection:
                            id: 3f9c2a71-5d4e-4b8a-9c1f-7e2d6a5b8c90
                            last_connected_at: null
                            name: Riverbend Electric
                            type: standard
                          delivery_id: 5c1e9a3b-7d2f-4a6e-8b0c-1f4d7a2e9b63
                          event: connection.setup_cancelled
                          links:
                            self: >-
                              https://qubesync.com/api/v2/connections/3f9c2a71-5d4e-4b8a-9c1f-7e2d6a5b8c90
                          revision: 1
                          sandbox: false
                          timestamp: 1792349550
                      stalled:
                        summary: The Web Connector hasn't checked in when it was due
                        value:
                          app_id: 98f339a4-32e8-424a-987e-ccaf5bcaa620
                          connection:
                            expected_check_in_at: '2026-10-20T08:05:21Z'
                            id: 3f9c2a71-5d4e-4b8a-9c1f-7e2d6a5b8c90
                            last_connected_at: '2026-10-20T08:00:21Z'
                            name: Riverbend Electric
                            stall_reason: not_checking_in
                            type: standard
                            waiting:
                              oldest_queued_at: '2026-10-20T08:12:40Z'
                              requests: 3
                          delivery_id: a2d4f6b8-1c3e-4a5b-9d7f-0e2c4a6b8d10
                          event: connection.stalled
                          links:
                            self: >-
                              https://qubesync.com/api/v2/connections/3f9c2a71-5d4e-4b8a-9c1f-7e2d6a5b8c90
                          revision: 2
                          sandbox: false
                          timestamp: 1792485001
                      stalled_quickbooks_unavailable:
                        summary: >-
                          The Web Connector is checking in but can't reach
                          QuickBooks
                        value:
                          app_id: 98f339a4-32e8-424a-987e-ccaf5bcaa620
                          connection:
                            expected_check_in_at: '2026-10-21T14:40:00Z'
                            id: 8b2e4d6f-1a3c-4e5b-9f7d-0c2a4e6b8d1f
                            last_connected_at: '2026-10-21T14:19:44Z'
                            name: Hollis Dental
                            stall_reason: quickbooks_unavailable
                            type: realtime
                            waiting:
                              oldest_queued_at: '2026-10-21T14:02:30Z'
                              requests: 2
                          delivery_id: d4f6a8c0-2e4b-4c6d-8a1f-3b5d7f9a1c23
                          event: connection.stalled
                          links:
                            self: >-
                              https://qubesync.com/api/v2/connections/8b2e4d6f-1a3c-4e5b-9f7d-0c2a4e6b8d1f
                          revision: 2
                          sandbox: false
                          timestamp: 1792592405
                    schema:
                      $ref: '#/components/schemas/ConnectionWebhook'
                required: true
              responses:
                2XX:
                  description: >-
                    Received. Anything else is retried with backoff for about 8
                    hours; after the last attempt, your organization's owners
                    are emailed.
              summary: Something happened to the connection
              method: post
              type: path
            path: '{$request.body#/webhook_url}'
      security:
        - apiKey: []
components:
  schemas:
    Connection:
      properties:
        app_id:
          format: uuid
          type: string
        backing_off:
          description: >-
            `true` while the Web Connector's last tries couldn't open QuickBooks
            (on that computer it's closed, or a dialog is open) and QuBe Sync is
            spacing its tries out, up to 30 minutes apart.
            `next_check_in_expected_at` is the next try. It ends at the first
            session that reaches QuickBooks, and clicking Update Selected in the
            Web Connector tries straight away.
          type: boolean
        company_file:
          nullable: true
          type: string
        created_at:
          description: >-
            When the connection was made. With `last_connected_at` still `null`,
            it has never connected.
          format: date-time
          type: string
        id:
          format: uuid
          type: string
        last_connected_at:
          format: date-time
          nullable: true
          type: string
        links:
          properties:
            onboarding:
              description: >-
                Send the user here to connect QuickBooks. `null` once used, or
                if never generated.
              format: uri
              nullable: true
              type: string
            self:
              format: uri
              type: string
            ui:
              description: This connection in the QuBe Sync dashboard.
              format: uri
              type: string
          required:
            - self
            - ui
          type: object
        name:
          nullable: true
          type: string
        name_index:
          $ref: '#/components/schemas/NameIndex'
        next_check_in_expected_at:
          description: >-
            When the Web Connector is next expected to check in and pick up
            queued requests, worked out from its last check-in, its schedule and
            any wait QuBe Sync gave it: every 10 seconds for `realtime`, every 5
            minutes for `standard`, up to 30 minutes apart while `backing_off`,
            and slower while a sandbox app's `realtime` connection has nothing
            to do (`next_check_in_reason`). A request queued now is picked up
            then. `null` before the first check-in, and for a `simulated`
            connection that isn't backing off, since it runs as soon as a
            request is queued. A time more than a minute past means the check-in
            is late: a long session is still running (one of your requests is
            `sent`), or the Web Connector isn't running on the QuickBooks
            computer.
          format: date-time
          nullable: true
          type: string
        next_check_in_reason:
          description: >-
            What set `next_check_in_expected_at`. `schedule`: the connection's
            own pace. `backing_off`: the Web Connector's last tries couldn't
            open QuickBooks, as `backing_off`. `sandbox_idle`: a `realtime`
            connection in a sandbox app slows down while it has nothing to do,
            to once a minute after 10 minutes without a request and every 5
            minutes after an hour; the request you queue is picked up at that
            next check-in, and from then it's back to every 10 seconds. Clicking
            Update Selected in the Web Connector runs it at once. `null` when
            `next_check_in_expected_at` is.
          enum:
            - schedule
            - backing_off
            - sandbox_idle
          nullable: true
          type: string
        onboarding_token_expires_at:
          format: date-time
          nullable: true
          type: string
        qbxml_version:
          nullable: true
          type: string
        quickbooks_product_name:
          nullable: true
          type: string
        type:
          description: >-
            How QuickBooks is reached: `standard` (Web Connector polls every 5
            minutes), `realtime` (every 10 seconds), or `simulated` (a fake
            QuickBooks answered by QuBe Sync itself -- connected immediately, no
            Web Connector -- see the CLI/Quickstart guides; in beta: it doesn't
            match real QuickBooks in every case yet). Workflows and name
            matching run on `realtime` and `simulated` connections, not on
            `standard` ones.
          enum:
            - standard
            - realtime
            - simulated
          type: string
        username:
          description: >-
            Generated automatically; this is what the Web Connector
            authenticates as.
          type: string
        webhook_url:
          description: >-
            Where QuBe Sync sends the connection's own events:
            `connection.connected`, `connection.setup_cancelled`,
            `connection.stalled` and `connection.resumed` (see the callback on
            Create a connection). `null` when none is set, and then nothing is
            sent.
          format: uri
          nullable: true
          type: string
      required:
        - id
        - app_id
        - username
        - type
        - links
      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
    ValidationErrors:
      description: A field-by-field list of what was wrong. Nothing was saved.
      example:
        errors:
          redirect_url:
            - >-
              isn't taken in v2: set webhook_url instead, and QuBe Sync sends
              the connection's events there (connection.connected,
              connection.setup_cancelled)
      properties:
        errors:
          additionalProperties:
            items:
              type: string
            type: array
          type: object
      type: object
    ConnectionWebhook:
      description: >-
        The body QuBe Sync POSTs to a connection's `webhook_url` when something
        happens to the connection (see the callback on Create a connection),
        signed with `X-QUBE-Signature` like every other QuBe Sync webhook. It
        says what happened and the connection as the event left it. Never the
        Web Connector's username or password, the onboarding link, the company
        file or anything from QuickBooks: read the connection (`links.self`) for
        more.
      example:
        app_id: 98f339a4-32e8-424a-987e-ccaf5bcaa620
        connection:
          id: 3f9c2a71-5d4e-4b8a-9c1f-7e2d6a5b8c90
          last_connected_at: '2026-10-18T19:04:11Z'
          name: Riverbend Electric
          setup: first
          type: standard
        delivery_id: 0f8a6c2e-4b1d-4e7a-9c3f-2d5b8e1a7c40
        event: connection.connected
        links:
          self: >-
            https://qubesync.com/api/v2/connections/3f9c2a71-5d4e-4b8a-9c1f-7e2d6a5b8c90
        revision: 1
        sandbox: false
        timestamp: 1792350252
      properties:
        app_id:
          format: uuid
          type: string
        connection:
          description: The connection as the event left it, and what the event adds.
          properties:
            expected_check_in_at:
              description: >-
                `connection.stalled` only: when the Web Connector was due to
                check in, as the connection's `next_check_in_expected_at` said
                then. With a `stall_reason` of `quickbooks_unavailable` the Web
                Connector is checking in, so this is its next try after QuBe
                Sync's back-off, and may be in the future.
              format: date-time
              type: string
            id:
              format: uuid
              type: string
            last_connected_at:
              description: >-
                When the Web Connector last checked in, as of the event. `null`
                on a `connection.setup_cancelled` for a connection that has
                never connected.
              format: date-time
              nullable: true
              type: string
            name:
              nullable: true
              type: string
            setup:
              description: >-
                `connection.connected` only. `first`: the connection's first
                check-in. `again`: the first check-in after your customer chose
                Set up again on the connection's onboarding page, with a new Web
                Connector entry.
              enum:
                - first
                - again
              type: string
            stall_reason:
              description: >-
                `connection.stalled` only: why your requests are waiting.
                `not_checking_in`: the Web Connector hasn't checked in when it
                was due, so the QuickBooks computer is probably off or offline;
                ask your customer to turn it on and check the Web Connector.
                `quickbooks_unavailable`: the Web Connector is checking in but
                can't reach QuickBooks, usually because QuickBooks isn't open
                with the company file, or is showing a dialog; ask your customer
                to open QuickBooks. A stall can change reason while it goes on
                (a computer turned on in the morning, before QuickBooks is
                open): the event then comes again with the new reason and a
                newer `revision`.
              enum:
                - not_checking_in
                - quickbooks_unavailable
              type: string
            stalled_at:
              description: >-
                `connection.resumed` only: when the stall it ends began, its
                `connection.stalled`.
              format: date-time
              type: string
            type:
              enum:
                - standard
                - realtime
                - simulated
              type: string
            waiting:
              description: >-
                `connection.stalled` only: your requests waiting to be taken
                (`waiting` or `retryable`).
              properties:
                oldest_queued_at:
                  description: When the oldest was queued.
                  format: date-time
                  type: string
                requests:
                  description: How many.
                  type: integer
              required:
                - requests
                - oldest_queued_at
              type: object
          required:
            - id
            - name
            - type
            - last_connected_at
          type: object
        delivery_id:
          description: >-
            New for each event, and the same on every retry of it: take each one
            once.
          format: uuid
          type: string
        event:
          description: >-
            `connection.connected`: the Web Connector checked in for the first
            time, or for the first time since Set up again.
            `connection.setup_cancelled`: your customer chose Cancel setup on
            the onboarding page. `connection.stalled`: your requests have waited
            past the grace, for the reason `connection.stall_reason` gives (sent
            again, with the new reason, if it changes while the stall goes on).
            `connection.resumed`: they aren't any more.
          enum:
            - connection.connected
            - connection.setup_cancelled
            - connection.stalled
            - connection.resumed
          type: string
        links:
          properties:
            self:
              description: The connection in the v2 API, as it is now.
              format: uri
              type: string
          required:
            - self
          type: object
        revision:
          description: >-
            The connection's event counter: one up with every event, across all
            four. Deliveries can come out of order (a retried
            `connection.stalled` after its `connection.resumed`, say), so apply
            an event only when its revision is newer than the last you applied.
          type: integer
        sandbox:
          type: boolean
        timestamp:
          description: Unix seconds; also the `t=` in the signature header.
          type: integer
      required:
        - event
        - delivery_id
        - revision
        - timestamp
        - app_id
        - sandbox
        - connection
        - links
      type: object
    NameIndex:
      description: >-
        QuBe Sync's index of the names in this connection's company file, for
        finding records by name (see Match a name): customers, vendors,
        employees and other names, items, accounts, classes, and the other lists
        a transaction names (terms, sales tax codes, payment and ship methods,
        price levels, customer, vendor and job types, sales reps and customer
        messages). Only `realtime` and `simulated` connections can have one, and
        it is built the first time something on the connection needs matching: a
        match, or opting in (`POST /connections/{connection_id}/name-index`).
        QuBe Sync then reads the lists from QuickBooks itself, a step at a time,
        and your requests always go first; those reads never appear among your
        requests and never send a webhook. An index unused for 30 days is
        deleted, and built again the next time it's needed.
      properties:
        as_of:
          description: >-
            When the index last caught up with QuickBooks: changes made in
            QuickBooks since then aren't in it yet. While it's used, it catches
            up after a Web Connector session that brought your requests, at most
            every 5 minutes. `null` unless `ready`.
          format: date-time
          nullable: true
          type: string
        records:
          description: >-
            How many records the index holds; while `building`, how many are in
            so far. `null` when `not_built` or `unavailable`.
          nullable: true
          type: integer
        state:
          description: >-
            `ready`: every list is in. `building`: QuBe Sync is reading the
            lists from QuickBooks, the first time, or again after the connection
            was pointed at another company file, went 90 days without your
            requests, or a build gave up. `not_built`: nothing on the connection
            has needed matching yet, or the index went unused for 30 days and
            was deleted. `unavailable`: the connection is `standard`, which
            can't have one.
          enum:
            - ready
            - building
            - not_built
            - unavailable
          type: string
      required:
        - state
        - as_of
        - records
      type: object
  responses:
    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
  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.