Guide
OAuth Client Authentication
iglooX uses OAuth 2.0 client credentials to authenticate kiosks and merchant-specific integrations. Each access token represents the application that requested it and is constrained to that application's owner and assigned scopes.
Getting Credentials
Kiosks receive a client ID and secret from the one-time /kiosks/activation workflow.
Merchant integrations are created by an authenticated user through POST /v1.0/merchants/{uuid}/applications/oauth-clients. The user must have access to the merchant and hold the applications:write scope.
Both workflows return the client secret once; it cannot be retrieved later. Store it securely when you receive it. Credential responses include Cache-Control: no-store and Pragma: no-cache.
Selecting Scopes
The scope supplied during token exchange is a space-delimited subset of the scopes assigned when the client was created. Request only the scopes needed for the current integration.
Merchant-owned clients may be assigned:
business:read,business:writeloyalty-programs:read,loyalty-programs:writecustomers:read,customers:writeintegrations:read,integrations:writemedia-library:read,media-library:writemessaging:read,messaging:writeorders:read,orders:write
Account, OpenID Connect, and application-management scopes cannot be assigned to merchant-owned clients.
Kiosk clients are assigned the fixed scope set business:read loyalty-programs:read customers:read customers:write.
Loyalty Endpoint Scopes
| Operations | Required scopes |
|---|---|
| Search or retrieve loyalty programs | loyalty-programs:read or loyalty-programs:write |
| Create, edit, archive, or bulk-archive loyalty programs | loyalty-programs:write |
| Look up or search loyalty balance operations | customers:read or customers:write |
| Search/retrieve loyalty balances or search customer ledger entries | (customers:read or customers:write) and (loyalty-programs:read or loyalty-programs:write) |
| Create top-up intents or mutate loyalty balances | customers:write |
Client Credentials Workflow
- Obtain a client ID and one-time client secret using one of the credential workflows above.
- Select a space-delimited subset of the scopes assigned to that client.
- Exchange the client ID, client secret, and selected scopes for an access token.
- Send the access token to a compatible API endpoint in the
Authorizationheader. - Obtain a replacement token before the current token expires. Client-credentials tokens do not have refresh tokens.
Exchange the Credentials
Submit the credentials to the accounts service using the client_credentials grant and an application/x-www-form-urlencoded request:
curl --request POST 'https://account.igloox.co/oauth/token' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'grant_type=client_credentials' \
--data-urlencode 'client_id=<client ID>' \
--data-urlencode 'client_secret=<client secret>' \
--data-urlencode 'scope=business:read customers:write'
A successful exchange returns a bearer access token:
{
"token_type": "Bearer",
"expires_in": 2592000,
"access_token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9..."
}
Client-credentials access tokens are valid for 30 days and do not include refresh tokens.
Call the API
Send the access token using the Bearer authentication scheme. Do not put access tokens in query parameters or request bodies.
curl --request GET 'https://api.igloox.co/v1.0/merchants/<merchant UUID>' \
--header 'Authorization: Bearer <access token>'
The endpoint's Authentication section lists the accepted scope combinations. When more than one scope combination is shown, satisfying any one combination is sufficient. Some endpoints are restricted to a particular principal type even when the token contains the required scopes; those restrictions are stated in the endpoint description.
Token Endpoints
| Environment | Endpoint |
|---|---|
| Production | https://account.igloox.co/oauth/token |
| Staging | https://account.staging.igloox.co/oauth/token |