- How to call the Batch endpoint with mixed operations (create, update, delete, query)
- How to validate results with Postman tests
- Best practices for performance and rate limiting
- Max 50 BatchItemRequest items per batch
- Max 40 batch requests per minute per realmId
- Each BatchItemRequest is metered like a normal call (no cost discount)
- Operations are independent; order is not guaranteed; do not create dependencies across items
- Authenticate once per batch (Bearer token applies to all items)
- QuickBooks Online company and
realmId - OAuth 2.0 access token with required scopes
- Postman (latest) installed
- Import files from
postman/:QuickBooks-Batch.postman_environment.jsonQuickBooks-Batch.postman_collection.json
- In the Postman environment, set:
baseUrl→https://quickbooks.api.intuit.com(or sandbox URL)realmId→ your company IDminorVersion→ e.g.,75accessToken→ a valid Bearer token (noBearerprefix in the variable)
- Open the collection: QuickBooks Batch → Requests → "Batch - Mixed Operations"
- Send the request. The test tab will:
- Assert HTTP 200
- Parse
BatchItemResponse[] - Count failures (Faults) vs successes
- Validate
bIdmapping
- Try the "Batch - Query Only" request to fetch records via a SELECT query.
- Success items contain the resource payload under their type (e.g.,
Vendor,Invoice) - Query items return
QueryResponse - Failed items include a
Faultobject with codes/details - Use
bIdto correlate each response to its request item
- Prefer Query to fetch many records of one resource; use Batch to group independent writes/reads
- Keep each item minimal (sparse updates) to reduce payload size
- Avoid intra-batch dependencies; split into separate batches when order matters
- On partial failure, retry only failed
bIds; implement exponential backoff for429 - Monitor both per-minute (batch) and per-operation rate limits; handle
Retry-After - Log
bId, operation, and result for traceability - Always pass
minorversionto ensure consistent behavior
- Expecting Batch to reduce cost/quota — it does not; each item is metered
- Assuming creation within a batch is immediately usable by another item in the same batch
- Ignoring partial failures — always inspect
BatchItemResponsearray
- 401/403: token expired/insufficient scope → refresh token / re-grant scope
- 429: per-minute batch quota or downstream rate limits → backoff and retry
- ValidationFault: check required fields,
SyncTokenfor updates, or duplicate constraints
- Max throughput per realmId ≈ 50 items × 40 batches/min = ~2,000 ops/min (subject to downstream limits).
- Use the collection folder "Batch - Max 50 Items (Queries)" to send 50 query items in one batch.
- Automate with Newman to approach per-minute caps without 429s:
- Add
--delay-request 1500and--iteration-count 40to stay under 40/min per realmId.
- Add
- If you want to provoke throttling for demo purposes, reduce delay and observe 429 with rule name
v3/*-Realm Id per Minute.