OAuth Bearer Token

The OAuth Bearer Token provides full read/write access to most Limio APIs. Those APIs can be used for posting Orders, adding Identities, retrieving Abandoned Baskets, and more.

Using the Client Credentials Method to Authenticate with Limio's APIs

The client credentials method for generating an OAuth Bearer Token allows secure, server-to-server authentication without user involvement. It enables interaction with most of Limio's APIs, including the Order API, Subscription API, Abandoned Basket API, and External Identities API. This is typically the method you will use to get started.

Prerequisite

To access Limio's API via the OAuth Bearer Token, you will first need your client_id and client_secret. To obtain these credentials, please contact Limio Support via this link.

How to get your Bearer Token

Endpoint: To create your Bearer Token, you need to send a request to the following endpoint:

POST {{tenant}}/oauth2/token

Headers: You will need to include the following headers in your request:

Header

Value

Content-Type

'application/x-www-form-urlencoded'

Request body: You will need to include the following payload in your request:

Form Parameters

Value

grant_type

client_credentials

client_id

The client_id you received from Limio Support.

client_secret

The client_secret you received from Limio Support.

Example: For example, to request a Bearer token, you can send a request using cURL:

 curl --request POST \
  --url https://{tenant}/oauth2/token \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --data grant_type=client_credentials \
  --data client_id={client_id_details} \
  --data client_secret={client_secret_details}

Response: This will return the following response:

HTTP/1.1 200 OK 
Content-Type: application/json

{ 
    "access_token":"<Bearer <YOUR_TOKEN_HERE>",
    "token_type":"Bearer", 
    "expires_in":3600 
}

Next steps: Place your Access Token ("<Bearer <YOUR_TOKEN_HERE>") to use in the authorisation header of all API calls set to the BearerAuth. For example, to call the Order Api, you'd use:

const basePath = 'api';
const domain = 'prod.limio.com' or 'prod-us.limio.com';
const shard = 'tenant';
const resp = await fetch(
  `https://${shard}.${domain}/${basePath}/order`,
  {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
      Authorization: 'Bearer <YOUR_TOKEN_HERE>'
    }...

Last updated

Was this helpful?