Skip to main content
Question

Quickbooks Online Authorization: Auth2.0 Tokens expiring after 24hrs

  • Nov 9, 2024 4:56 PM UTC
  • 1 reply
  • 156 views

Forum|alt.badge.img

Getting an "invalid_grant" error after 24hrs. 

For the life of me I cannot figure out how to keep the tokens working past 24hrs. This pipeline runs every hour and returns updated refresh and access tokens. Everything works fine for 24hrs. 

This is from Inutuit Dev: 

"Tip: We update the value of the refresh_token value every 24 hours hours, or the next time you refresh the access tokens after 24 hours. This is an additional security measure by Intuit to reduce risk of compromise."

Somehow refreshing both every hour is not meeting this requirement? We had a pipeline running every 12hrs also to get a refresh token separately but the results were the same. I feel like we are close, but just missing the timing of the pipelines or something else simple.  PLEASE HELP!!

I can provide more information beyond the two attachments as needed.

1 reply

Top Step
Forum|alt.badge.img+12
  • Observing
  • Nov 4, 2026 11:53 PM UTC

invalid_grant right at the 24 hour mark almost always means an old refresh token is being sent.

Intuit returns the same refresh token for about a day. After that, the next refresh hands back a new one and the old one stops working immediately. So everything looks fine for 24 hours, and then a run that still has the old value fails.

Two things I’d check. Make sure every run writes both the access_token and the refresh_token from the response back to your record, even when they look unchanged, and that the next run reads the refresh token from that record rather than a value saved in the step.

And make sure only one pipeline refreshes. If your 12 hour pipeline and the hourly one each keep their own copy of the token, whichever one runs after the rotation is holding a dead token. I’d turn the 12 hour one off.

Once it has failed you’ll need to reconnect once to get a fresh refresh token, then it should keep rolling.

Also worth a look: if you’re doing standard things like creating customers or invoices, the QuickBooks Online channel in Pipelines handles the tokens for you.

Want more detail? I wrote a full walkthrough here: https://www.topstep.tech/blog/quickbase-pipelines-quickbooks-online-token-refresh