Flow overview
0. Register your app
First, you need aclient_id and client_secret. This is done through the Lojou dashboard (not an API call) — contact support or register your app under Settings → Apps/Integrations to receive credentials and register your allowed redirect_uri(s).
1. Send the seller to authorize
Redirect the seller’s browser to Lojou’s authorization screen, with your app’sclient_id and the redirect_uri (must match exactly what was registered in step 0):
Confirm the exact URL for this screen with the Lojou team when you register your app (step 0) — what matters for your integration is the
client_id/redirect_uri pair, which the API validates regardless of which page hosts it.2. Handle the callback
If the seller approves, Lojou redirects back to yourredirect_uri with two parameters:
code— single-use, expires in 10 minutes.state— the same value Lojou generated for this flow; use it to confirm the response matches an authorization you actually started (CSRF protection).
3. Exchange the code for a token
access_token and refresh_token scoped to that seller (one per connected store) — never to your app as a whole.
4. Call the API on the seller’s behalf
/v1/* endpoint works the same whether the token came from OAuth or an API key — the only difference is how the token was issued.
Common errors
Scopes
The seller only approves the scopes your app requested — and may approve a subset of them, depending on what they accept on the authorization screen. Thepermissions field in the token response tells you exactly what was granted; call GET /v1/scopes at any time to check again.