Theme
QuickBooks API proxy
The Odoo module calls the QuickBooks Online Accounting API through QBO Connect. Paths, query strings and bodies are the ones in Intuit's reference. Only the base URL changes: the module sends each request to QBO Connect, signed with the instance secret, instead of to Intuit with a bearer token. QBO Connect checks the request, adds the connection's stored access token, forwards it to Intuit, and returns Intuit's status and body unchanged. Intuit tokens never leave QBO Connect (ADR-019).
There is one generic route and no per-entity endpoint. Every operation in folders 1–12 of the collection goes through it.
Request URL
| QBO Connect | {{base_url}}/api/v1/qbo/v3/company/{{realm_id}}/<resource> |
| Forwarded to (sandbox) | https://sandbox-quickbooks.api.intuit.com/v3/company/<realmID>/<resource> |
| Forwarded to (production) | https://quickbooks.api.intuit.com/v3/company/<realmID>/<resource> |
QBO Connect uses the environment it runs in (QBO_ENVIRONMENT). A connection made in the other environment is refused with 409 environment_mismatch. It adds minorversion=75 to the forwarded query when the request does not set one.
| Collection request | Forwarded to Intuit |
|---|---|
GET …/qbo/v3/company/{{realm_id}}/invoice/{{invoice_id}} | GET /v3/company/<realmID>/invoice/<id>?minorversion=75 |
GET …/qbo/v3/company/{{realm_id}}/query?query=select * from Item | GET /v3/company/<realmID>/query?query=…&minorversion=75 |
POST …/qbo/v3/company/{{realm_id}}/invoice?requestid={{request_id}} | POST /v3/company/<realmID>/invoice?requestid=…&minorversion=75 |
POST …/qbo/v3/company/{{realm_id}}/invoice/{{invoice_id}}/send?sendTo=… | POST /v3/company/<realmID>/invoice/<id>/send?sendTo=… |
Request rules
| Rule | Value |
|---|---|
| Path | v3/company/{realmId}/ followed by 1–6 segments of [A-Za-z0-9_-]. Anything else returns 404 not_found. |
| Company | realm_id must belong to a connection of the calling instance (else 404). The connection must be active and in the current environment, and the licence must be active (409 / 403). |
| Methods | GET and POST. Anything else returns 405. |
| POST body | At most 5 MiB (413 payload_too_large). Accepted types: application/json; application/text for queries; text/plain; application/octet-stream only with an empty body on {entity}/{id}/send. Anything else, including multipart uploads, returns 415 unsupported_media_type. |
| Query string | At most 50 parameters. Names match [A-Za-z][A-Za-z0-9_]*. Values are strings of up to 8000 characters, forwarded exactly as sent. |
| Accept | application/json (the default), application/xml, application/pdf or text/plain. |
| Timeout | 125 seconds. Intuit times out at 120 seconds. |
Headers
You send: the four signing headers (added by the collection's pre-request script), Accept, and Content-Type on POST. Do not send Authorization: QBO Connect adds the bearer token itself.
Sent to Intuit: only Authorization: Bearer <stored token>, Accept, Content-Type and User-Agent.
You receive:
| Header | Value |
|---|---|
X-QBO-Upstream-Status | Intuit's HTTP status. Present only on responses that came from Intuit. |
intuit_tid | Intuit's transaction id. Log it and quote it to Intuit support. |
Content-Type | Intuit's content type, for example application/json or application/pdf. |
Content-Disposition | Intuit's, when present (PDF downloads). |
Cache-Control, Pragma | no-cache, no-store and no-cache. |
Retry-After | On 429: seconds to wait. |
Other headers from Intuit, such as cookies and server information, are dropped.
Writes and requestid
Every write in the collection sends requestid={{request_id}}. The pre-request script generates a new value (pm- + 30 hex characters) before signing.
- Intuit: a request id must be unique per company. It is at most 50 characters, or 36 for batch. Re-sending the same
requestidreturns the original response instead of creating a duplicate. - QBO Connect resubmits a POST after a
5xxor a network error only when it carriesrequestid. Always send one on writes.
Responses
There are two kinds of responses, and the X-QBO-Upstream-Status header tells them apart.
X-QBO-Upstream-Status | Where the response comes from | Body |
|---|---|---|
| present | Intuit answered. QBO Connect relays the status and body unchanged. | Intuit's body: the entity, a QueryResponse, a PDF, or a Fault. |
| absent | QBO Connect refused the request or could not reach Intuit. | QBO Connect's {"error": {...}} envelope (see errors). |
A 200 from Intuit can still contain a Fault: parse the body. Intuit's JSON fault, as quoted in docs/research/intuit-accounting-api.md:
json
{
"Fault": {
"Error": [
{
"Message": "<message>",
"Detail": "<detail>",
"code": "<code>",
"element": ""
}
],
"type": "ValidationFault"
},
"time": "2017-09-29T09:17:31.892-07:00"
}Faults that matter for these requests:
| Code | Meaning | Source |
|---|---|---|
6240 | Duplicate Name Exists | Intuit |
5010 | Stale Object: an old SyncToken | Intuit |
6220 | List item with an open balance cannot be deactivated | Seen on the sandbox |
6430 | Wrong income account type for an inventory item | Seen on the sandbox |
2020 | Required parameter missing (for example a sparse Bill update) | Seen on the sandbox |
Retries and refresh
- Intuit
401: QBO Connect refreshes the access token once and retries once. If Intuit rejects the refresh token (invalid_grant), the connection becomesreauth_requiredand the call returns409 connection_reauth_required. - Intuit
500,502,503,504, or a network error:- resubmitted once for GET, and for POST only with
requestid; - a connect or DNS timeout counts as a network error, because the request never reached Intuit;
- a timeout after the request was sent is never resubmitted;
- if the network error persists, the call returns
503 intuit_unavailable.
- resubmitted once for GET, and for POST only with
- Intuit
429: relayed withRetry-Afterof at least 60 seconds. QBO Connect then pauses that company for 60 seconds, and calls during the pause get429 rate_limited.
Limits
| Limit | Value | Response |
|---|---|---|
| Per instance | 1000 requests per minute | 429 rate_limited |
| Per QuickBooks company | 10 per second and 500 per minute (Intuit's limits). Internal retries count too. | 429 rate_limited + Retry-After |
| Batch, per company | 40 per minute | 429 rate_limited |
| Plan's monthly API quota | Requests that reached Intuit, per licence, per calendar month (UTC) | 429 quota_exceeded, details.scope: "license"; Retry-After = start of next month |
Proxy errors
| HTTP | error.code | When |
|---|---|---|
| 403 | license_inactive | The licence is not active. |
| 404 | not_found | Not a company API path, or the company is not connected to this instance. |
| 405 | method_not_allowed, http_error | Method other than GET or POST. |
| 409 | connection_reauth_required | QuickBooks access expired or was revoked. Reconnect. |
| 409 | connection_disconnected | The connection is disconnected. Connect again. |
| 409 | environment_mismatch | The connection belongs to the other QuickBooks environment. |
| 413 | payload_too_large | Body over 5 MiB. |
| 415 | unsupported_media_type | Body type not accepted (see the rules above). |
| 422 | validation_failed | Query string breaks the rules above. |
| 429 | rate_limited, quota_exceeded | See Limits. |
| 503 | intuit_unavailable | Intuit could not be reached. |
How the collection checks proxied calls
The QuickBooks API (proxy) folder runs these tests after every request inside it:
relayed from QuickBooks (X-QBO-Upstream-Status). Fails on a QBO Connect error and prints its body.intuit_tid present.no QuickBooks Fault. JSON responses only.
Each request then has its own tests, for example the HTTP status and the returned entity, and stores the ids and SyncTokens that later requests use.
Run order and test data
- Set
realm_id: List connections stores it. - Run folders 1 → 12 in order. Later folders use ids stored by earlier ones: accounts, tax codes, customer, vendor, item.
- Test records are named
QBOC-TEST <run_id> …. 1. CompanyInfo starts a newrun_id, so names stay unique across runs. - Folder 3b only runs with
allow_permanent_tax_writes=true. It needs a Postman version withpm.execution.skipRequest.
| Page | Folder |
|---|---|
| CompanyInfo and Preferences | 1. Company & setup |
| Account | 2. Accounts (chart of accounts) |
| Tax | 3. Tax (TaxCode, TaxRate, TaxAgency) · 3b. Tax set-up writes |
| Customer | 4. Customers |
| Vendor | 5. Vendors |
| Item | 6. Products & services (Item) |
| Invoice | 7. Invoices |
| Payment | 8. Customer payments (Payment) |
| CreditMemo | 9. Credit memos |
| Bill and BillPayment | 10. Bills & bill payments |
| Query, CDC and batch | 11. Pagination, filtering, CDC & batch |
| Cleanup | 12. Cleanup (deactivate test data) |
Intuit's own operation matrix, payloads and constraints for these entities are in docs/research/intuit-accounting-entities.md.