Authenticating Store Inventory Management REST APIs
Learn how to authenticate by using OAuth2 client credentials before calling the Store Inventory Management REST APIs.
Before you begin
Ensure that you have completed the onboarding process and received the hostname
,
tenantId
, client_id
, and client_secret
through an
email.
About this task
You can call the Store Inventory Management REST APIs by using OAuth2 client credentials.
Procedure
Example
tenantId=tenant-abc
client_id=xyz
client_secret=123
To call the Create a location REST API, complete the following:
- Generate a token by calling the auth API,
https://<hostname>/tenant-abc/oauth2/token, with HTTP
method as POST with the following parameters:
- Headers
- Content-Type :
application/json
- Content-Type :
- Request
Body
{ "client_id" : "xyz", "client_secret" : "123", "grant_type" : "client_credentials" }
- Response contains the
token
{ "token_type" : "bearer", "access_token" :"<token>", "expires_in":"7200" }
- Headers
- Call the Create a location REST API – (prefix host and
tenantId
to the URI).- POST https://<hostname>/tenant-abc/v1/stores/storeId/locations
- Headers
- Content-Type : application/json
- Authorization: Bearer <token>
- Request body - API body