Oligon Receipts is in private beta — request access.
API reference
OAuth

OAuth

Google sign-in. Two endpoints — only the first is meant to be hit by a browser (window.location = ...). The second is the redirect target Google calls; your code should never invoke it directly.

MethodPathCaller
GET/v1/auth/oauth/google/startBrowser navigation
GET/v1/auth/oauth/google/callbackGoogle (server-to-browser redirect)

GET /v1/auth/oauth/google/start

Begins the OAuth flow. Generates a CSRF state token, sets it in an HttpOnly cookie (oligon_oauth_state), then 302-redirects the browser to Google's consent screen with scope=openid email profile.

Query parameters

NameTypeRequiredNotes
nextstringnoPath on the portal to land on after success. Defaults to /dashboard. Must start with /.
<a href="https://api.receipts.oligontech.com/v1/auth/oauth/google/start?next=/settings">
  Sign in with Google
</a>

Errors

StatusCodeCause
400validation_errorGoogle OAuth not configured (GOOGLE_CLIENT_ID / secret missing on the server).

GET /v1/auth/oauth/google/callback

Google redirects here with ?code=...&state=.... The server:

  1. Validates state against the cookie.
  2. Exchanges code for a Google access token.
  3. Fetches the user profile (/oauth2/v3/userinfo).
  4. Upserts a User (by google_sub, then by email).
  5. If the user has no membership, creates an Org + Subscription + owner Membership on the fly.
  6. Sets oligon_access and oligon_refresh cookies.
  7. 302-redirects to PORTAL_BASE_URL + next (defaults to /dashboard).

Errors

StatusCodeCause
401authentication_failedstate mismatch, Google email not verified, or missing profile fields.
502external_service_errorToken exchange or userinfo call to Google failed.

There is no JSON response — the endpoint always either redirects or raises an error envelope.