Skip to main content
In this section, we will setup the integration for the billing service. We will create a new integration and add the necessary details to the integration.
1

Initiate the UI to access the user token and org id

Our Billing SDK expects the user token and org id to be passed to it. This is used to validate the user session and the organization session.
We are in progress of adding support of org id. We will update this section once we have added support of org id.
2

Setup an authentication endpoint in your application

Our Billing API requires an authentication endpoint in your application that will be used to validate the user session.For more information on how the authentication works, please refer to the Authentication and Authorization section.
This endpoint should be a private endpoint which can accept the user session token of your application and validate it, and then return the user information.Expected Request Headers:
{
  "Authorization": "Bearer user_token",
  "X-Org-Id": "org_id"
}
Expected Response if user is authenticated and belong to the organization:
{
  "id": "user_id",
  "email": "user_email@gmail.com",
  "name": "user_name"
}
Expected Response if user is not authenticated or does not belong to the organization: Http status code: 401
{
  "error": "Unauthorized"
}
This ensures that the user information is validated and the user is authenticated by your service.
I