Integrating Lightspeed O‑Series Data into Bold BI Using OAuth 2.0
This article provides a step-by-step guide on integrating Lightspeed (O‑Series) data into Bold BI.
To establish a secure connection and authenticate requests to the Lightspeed API, you must obtain the following OAuth 2.0 credentials:
- Client ID
- Client Secret
- Redirect URL
- Authorization Code
These credentials are required to complete the authorization process and enable seamless data integration between Lightspeed and Bold BI.
1. Obtain OAuth Credentials from Lightspeed
According to Lightspeed’s guidelines, the OAuth credentials (Client ID, Client Secret) can only be obtained by creating a new integration application inside the Lightspeed (O‑Series) Back Office.
To create the integration app, the user must have Developer / Partner‑level permissions, as integrations are only visible to certified developer or partner accounts
- After creating the integration, Lightspeed provides the Client ID directly in the integration settings.
-
Please note that the Client Secret is displayed only once when the integration is created, so make sure to save it securely.
-
You must provide a valid redirect_uri.
-
To obtain the authorization code, open the URL below in your browser (replace the values with your own):
You will be redirected to the Lightspeed login screen. After logging in, select your company and click Grant Access. You will then be redirected to your redirect_uri, and the URL will contain a code,
For example:
https://webhook.site/… ?code=aabd0416d88dc7c51456cecf83dc83f98fccbb99&state=a1b2c3d4
The value after code=aabd0416d88dc7c51456cecf83dc83f98fccbb99 is the code you need to pass in the request body.
Important: The authorization code expires within 30 seconds to 1 minute. Please use it immediately.
2. Create the Access Token (required for API authentication)
After obtaining your OAuth credentials (Client ID, Client Secret, Redirect URL and Authorization code), you can generate an access token by sending a POST request to the Lightspeed (O‑Series) token endpoint.
Token Endpoint:
https://api.kounta.com/v1/token
Request Body:
{
"code": "Generated Authorization Code ",
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"grant_type": "authorization_code",
"redirect_uri": "Your_redirect URL"
}
The grant_type must be authorization_code
Once you send the POST request to the token endpoint, Lightspeed returns the following response:
{
"access_token": "3000f9761e19f9802754082aa143bd8bfea41135",
"expires_in": 3600,
"token_type": "Bearer",
"scope": null,
"refresh_token": "181829df81f81712503fe41c60c50f3638930c88"
}
The access token is required to securely access Lightspeed APIs, and It expires after 1 hour.
You must use the refresh_token to generate a new access token, because Lightspeed does not provide a permanent token.
Generate a New Access Token Using the Refresh Token:
Use the same token endpoint:
https://api.kounta.com/v1/token
Request Body:
{
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"refresh_token": "YOUR_REFRESH_TOKEN",
"grant_type": "refresh_token"
}
This will return a new access token.
Please refer to this document for more details on generating the access token: OAuth 2.0 Process – Lightspeed Restaurant POS (O-Series)
3. Integrate Lightspeed Data into Bold BI
Lightspeed provides multiple APIs for accessing company, product, sales, and operational data. For complete API specifications, refer to the official documentation:
Kounta by Lightspeed – API Documentation
Bold BI can connect to Lightspeed using the Web API Data Source. Since Lightspeed access tokens expire every hour, you must configure the integration using two data sources to ensure continuous, uninterrupted data retrieval.
Data Source 1 — Generate Access Token
This data source is responsible for generating and refreshing the Lightspeed access token using the refresh token obtained during the OAuth 2.0 flow.
Purpose
- Automatically generate a new access token before the previous token expires.
- Eliminate the need for manual token updates.
Steps
Configure a Web API data source to call the Lightspeed token endpoint and automatically generate a new access token by using the saved refresh token. Ensure that the grant_type is set to refresh_token.
Store the generated access token in a Dashboard Parameter so it can be reused across other data sources.
For detailed instructions, refer to the knowledge base article:
How to generate the access token automatically utilizing the Web API connector
Use Extract Mode and schedule the data source to refresh every 1 hour, since the Lightspeed access token is valid for one hour.
Data Source 2 — Fetch Lightspeed Data
This data source is responsible for retrieving actual Lightspeed data (e.g., products, orders, companies) using the access token generated in Data Source 1.
Example API Endpoint:
To fetch product details:
https://api.kounta.com/v1/companies/97331/products
Where:
97331= the Company ID obtained from Lightspeed
Authorization Header
To authenticate API requests, pass the access token using the Dashboard Parameter:
Bearer @{{:DataSourceName.ParameterName}}
DataSourceName → Name of Data Source
ParameterName → Dashboard Parameter storing the access_token.
This ensures the token is always up to date and eliminates the risk of API failures caused by expired tokens.
By following these steps, you can seamlessly and securely integrate Lightspeed data into Bold BI.