As a LoyaltyLion partner, you can authenticate with our API as an OAuth client. Our server implements the OAuth 2.0 specification.
OAuth authentication is designed only for LoyaltyLion partners building
apps to be used across many stores. If you’re building an integration for a
single store, use an API key.
Register your OAuth app
Before you can authenticate with OAuth, you’ll need to register your app with LoyaltyLion. To register a new OAuth app with LoyaltyLion, please email partnersupport@loyaltylion.com with the following information:
Once we’ve approved your OAuth 2.0 app, we’ll provide you with a client id
and secret. Your client secret must be kept private. If you believe it has
been compromised, please contact us immediately.
Initiate OAuth 2.0 approval
To kick off the OAuth flow, start by sending the user to our authorize URL, https://app.loyaltylion.com/oauth/authorize, with the following parameters:
Example authorize URL:
When a user is redirected to the authorize URL, we’ll show them your app name,
description and logo and ask them to approve the requested scopes.
Acquire access token
If the user approves the request, we’ll redirect them to your redirect_uri including a code as query param you can swap for an access_token.
For example:
To exchange the code for a permanent access token, your server should make a POST request with the code, your client id and your client secret.
If the exchange is successful, we’ll return a JSON response containing your permanent access token and a comma separated list of the approved scopes:
Use access token
Once you’ve received the access token, use it to make authenticated API requests allowed by the approved scopes. To do so, pass the access token using the bearer authentication scheme.
Resource scopes
Scopes let you specify the type of access your app needs, and limit the capability of the associated access tokens. When making your initial request to our authorize URL, you should pass through the scopes needed by your app as a comma separated list.
Our webhooks API is available to all access tokens, but you can only create webhooks for resources permitted by the token’s scope.