Added identity providers —
Check the API reference
LogoLogo
Other APIsChangelog
  • Welcome to Provisioning API
  • Getting started
    • API specification
    • Authorization
    • Applications
  • API reference
    • API credentials
      • The API credential object
      • Create an API credential
      • List all API credentials
      • Retrieve an API credential
      • Update an API credential
      • Delete an API credential
    • Application memberships
      • The application membership object
      • Create an application membership
      • List all application memberships
      • Retrieve an application membership
      • Update an application membership
      • Delete an application membership
    • Identity providers
      • The identity provider object
      • Create an identity provider
      • List all identity providers
      • Retrieve an identity provider
      • Update an identity provider
      • Delete an identity provider
    • Memberships
      • The membership object
      • Create a membership
      • List all memberships
      • Retrieve a membership
      • Update a membership
      • Delete a membership
    • Organizations
      • The organization object
      • Create an organization
      • List all organizations
      • Retrieve an organization
      • Update an organization
    • Permissions
      • The permission object
      • Create a permission
      • List all permissions
      • Retrieve a permission
      • Update a permission
    • Roles
      • The role object
      • Create a role
      • List all roles
      • Retrieve a role
      • Update a role
    • User
      • The user object
      • Retrieve the user
      • Update the user
    • Versions
      • The version object
      • List all versions
      • Retrieve a version
On this page
  • Getting the API credentials
  • Getting an access token
  • Example
  1. Getting started

Authorization

How to authenticate to the Provisioning API

PreviousAPI specificationNextApplications

Last updated 2 months ago

All API requests must be authenticated. To get authorized, you must include a valid access token in the Authorization :

Authorization: Bearer {{your_access_token}}

Getting the API credentials

First, you need to get your Provisioning API credentials. To do that, head over to the Dashboard, click on your user avatar in the upper right of the page to access your profile menu, and select Provisioning API from the dropdown:

Getting an access token

To get a valid access token you need to send a POST request to the following endpoint, providing the arguments listed in the table below:

https://auth.commercelayer.io/oauth/token
Body parameter
Type
Required
Description

grant_type

String

Required

client_credentials

client_id

String

Required

Your client_id.

client_secret

String

Required

Your client_secret.

Example

The following request tries to get an access token for the Provisioning API:

curl -g -X POST \
  'https://auth.commercelayer.io/oauth/token' \
  -H 'Content-Type: application/vnd.api+json' \
  -d '{
    "grant_type": "client_credentials",
    "client_id": "{{your_client_id}}",
    "client_secret": "{{your_client_secret}}"
}'

On success, the API responds with a 200 OK status code, returning the requested access token:

{
    "access_token": "abCde_FghI1jKLM2.nOp3QrS4t5UvW6.XYZ7Ab8cD9EFG-hIjk0L",
    "token_type": "Bearer",
    "expires_in": 7200,
    "scope": "provisioning-api metrics-api",
    "created_at": 123456789
}

On the you can find and copy to clipboard your Provisioning API credentials (client ID and client secret):

Where {{your_client_id}} and {{your_client_secret}} are the credentials you just got . You can now use the access_token you get in the response to perform authenticated requests to the Provisioning API (until it expires).

Once you got your credentials, you can also leverage our library to for the Provisioning API.

next page
JS Auth
get an access token
from the Dashboard
header