Skip to content

Postman docs › QuickBooks API (proxy) › Query, CDC and batch

Query, change data capture (CDC) and batch ​

Three ways to read or write many objects at once:

ResourceWhat it doesRequest
QueryReads one entity type with a SQL-like statement: count, filter, sort, page.GET …/query?query=<statement> or POST …/query with the statement as the body
CDCReturns the objects of several entity types that changed since a given time, deletes included.GET …/cdc?entities=<list>&changedSince=<dateTime>
BatchSends up to 30 creates, updates, deletes and queries in one request.POST …/batch

The entity pages use queries too; this page covers paging, counting, inactive objects, POST queries, CDC and batch.

Postman folder: 11. Pagination, filtering, CDC & batch. Intuit reference: Data queries · Batch · ChangeDataCapture.

The query language ​

text
SELECT * | count(*) FROM IntuitEntity [WHERE ...] [ORDERBY ...] [STARTPOSITION n] [MAXRESULTS n]
PartRule
EntityOne entity per query. No JOIN, no GROUP BY, no projections (select Name from … is not supported).
WHEREOnly fields marked filterable in Intuit's reference. Conditions are joined with AND; OR is not supported.
OperatorsIN, =, <, >, <=, >=, LIKE. LIKE supports only %. Id supports only = and IN.
ValuesQuote them with single quotes, as Intuit's examples do. Escape an apostrophe with a backslash: 'Adam\'s Candy Shop'. Null is ' ' (a space in quotes).
ORDERBYORDERBY Field [ASC|DESC]; ascending by default. Only sortable fields.
STARTPOSITION1-based. A positive integer.
MAXRESULTSA positive integer, at most 1000. The default is 100.
count(*)Returns QueryResponse.totalCount and no objects.
Inactive objects"If you query and don't filter for 'inactive' entities, the server only returns results for 'active' entities." Use Active = false or Active IN (true, false).
Case"Reserved words, entity names, and attribute names are not case sensitive. Attribute values are also not case sensitive."
ErrorsA query error comes back in QueryResponse.Fault, for example code 100 "OBJECT name not available".

In a URL, the whole statement goes in query= and must be URL-encoded. Write the LIKE wildcard % as %25, as the collection does, so that it is not read as the start of an escape sequence.

Through QBO Connect, a query value can be up to 8000 characters (see Request rules). Send longer statements in the body with POST. Queries (GET or POST) and batches count as reads for the monthly read quota, when that quota is turned on (see Limits).

Count objects ​

Counts the company's active customers.

Returns ​

QueryResponse.totalCount, a number. The test checks that it is a number.

Request
Request URLGET{{base_url}}/api/v1/qbo/v3/company/{{realm_id}}/query?query=select count(*) from Customer
Intuit operationGET/v3/company/<realmID>/query?query=<selectStatement>
Acceptapplication/json
Postman11. Pagination, filtering, CDC & batch › Count customers

Returns

json
{
  "QueryResponse": {
    "totalCount": 31
  },
  "time": "2026-12-01T02:33:00.000-08:00"
}

Page through results ​

Returns one page of customers, ordered by Id so pages do not overlap. Set start_position (default 1) and max_results (default 2) in the collection variables.

After each response, the test moves start_position to the next page: start_position + max_results. When a page has fewer rows than max_results, it was the last page, and start_position goes back to 1. Send the request repeatedly to walk through all customers.

Sample query (page 2 with max_results = 2)

text
select * from Customer ORDERBY Id STARTPOSITION 3 MAXRESULTS 2
Request
Request URLGET{{base_url}}/api/v1/qbo/v3/company/{{realm_id}}/query?query=select * from Customer ORDERBY Id STARTPOSITION {{start_position}} MAXRESULTS {{max_results}}
Intuit operationGET/v3/company/<realmID>/query?query=<selectStatement>
Acceptapplication/json
Postman11. Pagination, filtering, CDC & batch › Page through customers
Storesstart_position

Returns (abridged)

json
{
  "QueryResponse": {
    "Customer": [
      { "Id": "3", "DisplayName": "…" },
      { "Id": "4", "DisplayName": "…" }
    ],
    "startPosition": 3,
    "maxResults": 2
  },
  "time": "2026-12-01T02:33:10.000-08:00"
}

Include inactive objects ​

Lists every test item, active or not, with Active IN (true, false). Without that filter, deactivated items would be left out. The test checks the HTTP status only.

Request
Request URLGET{{base_url}}/api/v1/qbo/v3/company/{{realm_id}}/query?query=select * from Item where Active IN (true, false) and Name LIKE 'QBOC-TEST%25' MAXRESULTS 50
Intuit operationGET/v3/company/<realmID>/query?query=<selectStatement>
Acceptapplication/json
Postman11. Pagination, filtering, CDC & batch › Filter: include inactive items (Active IN)

Sample query (decoded)

text
select * from Item where Active IN (true, false) and Name LIKE 'QBOC-TEST%' MAXRESULTS 50

Send a query in the request body ​

The same query resource, with the statement as a plain-text body instead of in the URL. Use it for long or complex statements. The body is the statement itself, not JSON.

Request body ​

Content-Type: application/text. The statement, as plain text.

Returns ​

QueryResponse.Vendor[]. The test checks the HTTP status.

The body is part of the signature: the collection's pre-request script hashes it like any other body.

Request
Request URLPOST{{base_url}}/api/v1/qbo/v3/company/{{realm_id}}/query?requestid={{request_id}}
Intuit operationPOST/v3/company/<realmID>/query
Content typeapplication/text
Acceptapplication/json
Postman11. Pagination, filtering, CDC & batch › Query (POST, application/text)

Request body

text
select * from Vendor MAXRESULTS 3

Get changed objects (CDC) ​

Returns the customers, vendors, items, invoices, bills and payments that changed since changed_since, including deleted ones. Odoo can use it to catch up on changes, for example after missed webhooks.

Business rules

  • "Look-back time can be up to 30 days."
  • "A given CDC request returns a maximum of 1000 objects." Narrow changedSince or the entity list if you hit it.
  • CDC covers every entity "except JournalCode, TimeActivity, TaxAgency, TaxCode, and TaxRate."
  • "Objects deleted within the look-back period are returned after active objects." Deleted objects carry "status": "Deleted".

Query parameters ​

ParameterRequirementTypeDescription
entities* RequiredStringComma-separated entity names: Customer,Vendor,Item,Invoice,Bill,Payment.
changedSince* RequiredDateTimeISO 8601 time, at most 30 days ago. The collection uses changed_since, which 1. CompanyInfo sets to 6 hours ago.

Returns ​

CDCResponse, an array. Inside, one QueryResponse per entity type. The test checks that CDCResponse is an array.

Request
Request URLGET{{base_url}}/api/v1/qbo/v3/company/{{realm_id}}/cdc?entities=Customer,Vendor,Item,Invoice,Bill,Payment&changedSince={{changed_since}}
Intuit operationGET/v3/company/<realmID>/cdc?entities=<entityList>&changedSince=<dateTime>
Acceptapplication/json
Postman11. Pagination, filtering, CDC & batch › Change data capture (CDC)

Returns (abridged)

json
{
  "CDCResponse": [
    {
      "QueryResponse": [
        {
          "Customer": [
            { "Id": "64", "SyncToken": "1", "DisplayName": "QBOC-TEST mi4x2k Customer" }
          ],
          "startPosition": 1,
          "maxResults": 1
        },
        {
          "Invoice": [
            { "Id": "148", "status": "Deleted" }
          ],
          "startPosition": 1,
          "maxResults": 1
        }
      ]
    }
  ],
  "time": "2026-12-01T02:34:00.000-08:00"
}

Send a batch ​

Sends several operations in one request. Each item succeeds or fails on its own.

Business rules

  • "The maximum number of payloads in a single BatchItemRequest is 30."
  • "The maximum number requests to the batch endpoint per minute per realmID is 40." QBO Connect enforces 40 per minute per company and returns 429 rate_limited above it.
  • "Execution order of BatchItemRequest objects should not be assumed", and "a given object cannot depend on another one within the same batch operation." Batch 2 updates what batch 1 created, so they are two requests.
  • "Use the batch operation for transactions. Don't use it for list resources like customers, vendors, items, etc."
  • With requestid, each bId is at most 10 characters.
  • A failed item has a Fault instead of an entity, and the other items still run. On the sandbox, batch 1 returned HTTP 200 with a Fault only on bad (2026-12-01).

Request body ​

AttributeRequirementTypeDescription
BatchItemRequest* RequiredArray1–30 items.
BatchItemRequest[].bId* RequiredStringYour id for the item, unique in the batch. It comes back on the item's response.
BatchItemRequest[].operation* Conditionally requiredStringcreate, update or delete. Leave it out for a query: "When Query is defined, do not define the operation attribute."
BatchItemRequest[].<Entity>* Conditionally requiredObjectThe payload under its entity name, for example "Invoice": {…}. The same body as the single-entity request.
BatchItemRequest[].Query* Conditionally requiredStringA select statement, instead of an operation.
BatchItemRequest[].optionsDataOptionalStringvoid, with operation update, to void a transaction that supports it. Not used by the collection.

Batch 1 sends four items:

bIdItemExpected result
invCreate an invoice for the test customer (1 × item at 10)Invoice returned. Stored in batch_invoice_id, batch_invoice_sync_token.
cmCreate a credit memo for the test customer (1 × item at 5)CreditMemo returned. Stored in batch_creditmemo_id, batch_creditmemo_sync_token.
qselect * from Invoice where CustomerRef = '{{customer_id}}' MAXRESULTS 5QueryResponse returned.
badCreate an invoice whose customer and item ids (999999999) do not existFault returned, on purpose.

Returns ​

BatchItemResponse, one entry per item, each with its bId. The tests check that there are four responses, that inv, cm and q succeeded and that bad has a Fault.

The bad fault is the one the sandbox returned on 2026-12-01 (ValidationFault 2500 "Invalid Reference Id"). Because execution order is not guaranteed, q may or may not include the invoice that inv creates.

Request
Request URLPOST{{base_url}}/api/v1/qbo/v3/company/{{realm_id}}/batch?requestid={{request_id}}
Intuit operationPOST/v3/company/<realmID>/batch
Content typeapplication/json
Postman11. Pagination, filtering, CDC & batch › Batch 1: create invoice + credit memo + query + failing item
Storesbatch_invoice_id, batch_invoice_sync_token, batch_creditmemo_id, batch_creditmemo_sync_token

Request body

json
{
  "BatchItemRequest": [
    {
      "bId": "inv",
      "operation": "create",
      "Invoice": {
        "CustomerRef": { "value": "{{customer_id}}" },
        "Line": [
          {
            "DetailType": "SalesItemLineDetail",
            "Amount": 10,
            "Description": "QBO Connect Postman test",
            "SalesItemLineDetail": {
              "ItemRef": { "value": "{{item_id}}" },
              "Qty": 1,
              "UnitPrice": 10,
              "TaxCodeRef": { "value": "{{sales_tax_code_id}}" }
            }
          }
        ],
        "PrivateNote": "QBO Connect Postman batch"
      }
    },
    {
      "bId": "cm",
      "operation": "create",
      "CreditMemo": {
        "CustomerRef": { "value": "{{customer_id}}" },
        "Line": [
          {
            "DetailType": "SalesItemLineDetail",
            "Amount": 5,
            "Description": "QBO Connect Postman test",
            "SalesItemLineDetail": {
              "ItemRef": { "value": "{{item_id}}" },
              "Qty": 1,
              "UnitPrice": 5,
              "TaxCodeRef": { "value": "{{sales_tax_code_id}}" }
            }
          }
        ],
        "PrivateNote": "QBO Connect Postman batch"
      }
    },
    {
      "bId": "q",
      "Query": "select * from Invoice where CustomerRef = '{{customer_id}}' MAXRESULTS 5"
    },
    {
      "bId": "bad",
      "operation": "create",
      "Invoice": {
        "CustomerRef": { "value": "999999999" },
        "Line": [
          {
            "DetailType": "SalesItemLineDetail",
            "Amount": 1,
            "SalesItemLineDetail": {
              "ItemRef": { "value": "999999999" }
            }
          }
        ]
      }
    }
  ]
}

Returns (abridged)

json
{
  "BatchItemResponse": [
    {
      "bId": "inv",
      "Invoice": { "Id": "154", "SyncToken": "0", "TotalAmt": 11.3 }
    },
    {
      "bId": "cm",
      "CreditMemo": { "Id": "155", "SyncToken": "0", "TotalAmt": 5.65 }
    },
    {
      "bId": "q",
      "QueryResponse": {
        "Invoice": [
          { "Id": "154", "SyncToken": "0" }
        ],
        "startPosition": 1,
        "maxResults": 1
      }
    },
    {
      "bId": "bad",
      "Fault": {
        "type": "ValidationFault",
        "Error": [
          { "Message": "Invalid Reference Id", "code": "2500", "Detail": "…" }
        ]
      }
    }
  ],
  "time": "2026-12-01T02:35:00.000-08:00"
}

Update and delete in a batch ​

Batch 2 changes what batch 1 created: a sparse update of the batch invoice (upd) and a delete of the batch credit memo (del). The tests check that upd returned the invoice, and that del returned CreditMemo.status Deleted. The invoice's new SyncToken is stored for the delete that follows.

Request
Request URLPOST{{base_url}}/api/v1/qbo/v3/company/{{realm_id}}/batch?requestid={{request_id}}
Intuit operationPOST/v3/company/<realmID>/batch
Content typeapplication/json
Postman11. Pagination, filtering, CDC & batch › Batch 2: sparse update + delete
Storesbatch_invoice_sync_token

Request body

json
{
  "BatchItemRequest": [
    {
      "bId": "upd",
      "operation": "update",
      "Invoice": {
        "Id": "{{batch_invoice_id}}",
        "SyncToken": "{{batch_invoice_sync_token}}",
        "sparse": true,
        "PrivateNote": "Batch update by QBO Connect Postman test"
      }
    },
    {
      "bId": "del",
      "operation": "delete",
      "CreditMemo": {
        "Id": "{{batch_creditmemo_id}}",
        "SyncToken": "{{batch_creditmemo_sync_token}}"
      }
    }
  ]
}

Returns (abridged)

json
{
  "BatchItemResponse": [
    {
      "bId": "upd",
      "Invoice": { "Id": "154", "SyncToken": "1", "PrivateNote": "Batch update by QBO Connect Postman test" }
    },
    {
      "bId": "del",
      "CreditMemo": { "status": "Deleted", "domain": "QBO", "Id": "155" }
    }
  ],
  "time": "2026-12-01T02:36:00.000-08:00"
}

Delete the batch invoice ​

Deletes the invoice that batch 1 created, as in Delete an invoice. This leaves the test customer without an open balance, so 12. Cleanup can deactivate it. The test checks that Invoice.status is Deleted.

Request
Request URLPOST{{base_url}}/api/v1/qbo/v3/company/{{realm_id}}/invoice?operation=delete&requestid={{request_id}}
Intuit operationPOST/v3/company/<realmID>/invoice?operation=delete
Content typeapplication/json
Postman11. Pagination, filtering, CDC & batch › Delete batch invoice

Request body

json
{
  "Id": "{{batch_invoice_id}}",
  "SyncToken": "{{batch_invoice_sync_token}}"
}