Theme
Access token (handoff)
Access-token handoff gives the Odoo module a short-lived QuickBooks access token so it can call Intuit directly. It is disabled by default (ADR-019). Intuit's Developer Terms and its App Store security review restrict sharing tokens with other parties (see docs/compliance/INTUIT_COMPLIANCE.md). The supported integration is the QuickBooks API proxy.
Business rules
- Handoff is off on this service, so every call returns
403 token_handoff_disabled. Turning it on is a reviewed change to the service that requires written confirmation from Intuit. Health reports it ascapabilities.token_handoff. - Only the access token is handed out, never the refresh token.
- The same checks as the proxy apply: active licence, active connection, current environment.
- An access token close to expiry is refreshed before it is returned.
The access token object
| Attribute | Requirement | Type | Description |
|---|---|---|---|
connection_id | String | The connection the token belongs to. | |
realm_id | String | QuickBooks company id. | |
access_token | String | Bearer token for the QuickBooks Online Accounting API. Keep it in memory only. | |
token_type | String | bearer. | |
expires_at | String (ISO 8601) | When the token expires. | |
expires_in | Integer | Seconds until expires_at. | |
api_base_url | String (URL) | Intuit API base for the connection's environment. | |
minor_version | Integer | minorversion to send (75). | |
environment | String | sandbox or production. |
Get an access token
Returns a usable access token for one connection. Cache it until about 60 seconds before expires_at. If QuickBooks answers 401, request a new token once; if that also fails, show Reconnect.
The Postman test accepts 200 (handoff enabled) and 403 (the default).
Request body
| Attribute | Requirement | Type | Description |
|---|---|---|---|
connection_id | * Required | String | A conn_… id of the calling instance. |
Returns
200 OK with the access token object, sent with Cache-Control: no-cache, no-store.
Returns 200 OK (only when handoff is enabled)
json
{
"connection_id": "conn_01kbx7a2c9d4e6f8g0h1j3k5m7",
"realm_id": "9341455012345678",
"access_token": "eyJ…",
"token_type": "bearer",
"expires_at": "2026-12-01T11:03:12Z",
"expires_in": 3412,
"api_base_url": "https://sandbox-quickbooks.api.intuit.com",
"minor_version": 75,
"environment": "sandbox"
}Returns 403 Forbidden (default)
json
{
"error": {
"code": "token_handoff_disabled",
"message": "Access-token handoff is disabled. Use the QuickBooks API proxy (/api/v1/qbo/...)."
}
}Errors
| HTTP | error.code | When |
|---|---|---|
| 403 | token_handoff_disabled | Handoff is off (the default). |
| 422 | validation_failed | connection_id is missing or too long. |
| 404 | not_found | The connection does not belong to the calling instance. |
| 403 | license_inactive | The licence is not active. |
| 409 | connection_reauth_required | The user must reconnect, or no tokens are stored. |
| 409 | connection_disconnected | The connection is disconnected. |
| 409 | environment_mismatch | The connection belongs to the other QuickBooks environment. |
| 503 | intuit_unavailable | The token had expired and Intuit could not be reached to refresh it. |
| Request | |
|---|---|
| Request URL | POST{{base_url}}/api/v1/token |
| Content type | application/json |
| Authentication | Signed |
| Postman | Instance API › Get access token |
Request body
json
{
"connection_id": "{{connection_id}}"
}