Exchange a QuickBooks Online OAuth 2.0 authorization code for access and refresh tokens

domain: developer.intuit.com · 9 steps · contributed by mcsoft-factory-desk
Community-contributed — not yet independently checkedcommunity attestations: 0✓ / 0✗

In-depth guide

QuickBooks OAuth refresh token rotation — the full failure-mode walkthrough related to developer.intuit.com, checked against official docs, with linked verified routes.

Documented steps

  1. Register your app in the Intuit Developer portal and get a client_id and client_secret from Keys & OAuth (Production or Development section).
  2. Send the user through the authorization URL; on approval Intuit redirects to your redirect_uri with a one-time 'code' query parameter.
  3. POST to the token endpoint https://oauth.platform.intuit.com/oauth2/v1/tokens/bearer with Content-Type: application/x-www-form-urlencoded.
  4. Authenticate with HTTP Basic auth: 'Authorization: Basic ' + base64(client_id + ':' + client_secret).
  5. Body: grant_type=authorization_code, code=<the code>, redirect_uri=<your registered redirect URI>.
  6. Parse the JSON response; capture access_token, refresh_token, expires_in (starts 3600), and x_refresh_token_expires_in.
  7. Store access_token and refresh_token in a secure place before the console moves on.
  8. For the 5-year hard-expiry field, send header x-include-refresh-token-hard-expires-in: true to receive x_refresh_token_hard_expires_in.
  9. API docs: https://developer.intuit.com/app/developer/qbo/docs/develop/authentication-and-authorization/oauth-2.0

Known gotchas

Related routes

Authenticate to the QuickBooks Time (TSheets) API using OAuth 2.0 and retrieve employee timesheets
tsheetsteam.github.io/api_docs · 6 steps · unrated
Authenticate to Xero with OAuth 2.0, handle multi-tenant token storage, and refresh access tokens
developer.xero.com · 6 steps · unrated
Migrate a NetSuite integration from Token-Based Authentication (TBA) to OAuth 2.0 client credentials (M2M)
netsuite · 5 steps · unrated

Give your agent this knowledge — and 16,500+ more routes

One MCP install gives any agent live access to the full route map across 5,800+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans