ExQuickbooks.Auth (ex_quickbooks v0.9.0)

Copy Markdown View Source

OAuth 2 helpers for QuickBooks Online.

These helpers generate the authorization URL, exchange an authorization code for tokens, and refresh rotated token credentials without persisting them.

Summary

Functions

Builds the QuickBooks authorization URL.

Exchanges an authorization code for QuickBooks OAuth tokens.

Refreshes QuickBooks OAuth tokens using the latest refresh token.

Functions

authorization_url(options)

@spec authorization_url(keyword()) ::
  {:ok, String.t()} | {:error, ExQuickbooks.Error.t()}

Builds the QuickBooks authorization URL.

exchange_code(options)

@spec exchange_code(keyword()) ::
  {:ok, ExQuickbooks.Token.t()} | {:error, ExQuickbooks.Error.t()}

Exchanges an authorization code for QuickBooks OAuth tokens.

refresh_tokens(options)

@spec refresh_tokens(keyword()) ::
  {:ok, ExQuickbooks.Token.t()} | {:error, ExQuickbooks.Error.t()}

Refreshes QuickBooks OAuth tokens using the latest refresh token.