## TL;DR

Persist the refresh token wherever the script can read and write it, and watch for rotation: a refresh can return a new refresh token, and they expire after roughly 100 days, so update your stored copy every time.

## Steps

1. When QuickBooks OAuth2 feels too heavy for a script, split it in two. Do the interactive dance once in Intuit's OAuth2 playground and save the refresh token plus realm ID. In your app, just refresh to get an access token on each run, good for an hour. Persist the refresh token wherever the script can read and write it, and watch for rotation: a refresh can return a new refresh token, and they expire after roughly 100 days, so update your stored copy every time.

## When to use

You are seeing this: When QuickBooks OAuth2 feels too heavy for a script, split it in two. Use this skill when you run into "QuickBooks Online OAuth2: keep the refresh token, use the playground for the rest".

## When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

## Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

## Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
