/token
endpoint:
curl --location --request POST '${Authorization Url}/v1/token' \ --header 'accept: application/json' \ --header 'authorization: Basic <base64(${client-id}:${client-secret})>' \ --header 'cache-control: no-cache' \ --header 'content-type: application/x-www-form-urlencoded' \ --data-urlencode 'grant_type=client_credentials' \ --data-urlencode 'scope=s2s'
The authorization:
header in the request above is determined per HTTP Basic Authentication where the client-id
and client-secret
are used as username and password, respectively. Authorization Url
is a unique URL of each fabric merchant. It’s common across all system apps defined for a single merchant.
fabric Identity returns the access token in the following response:
{ "token_type": "Bearer", "expires_in": 600, "access_token": "eyJraWQiOiIt...", "scope": "s2s" }
access_token
is the system token generated by fabric Identity and is used by the system app for all subsequent fabric API calls. System token expiration is set to 10 minutes (600 seconds) by default. Once the token expires, the API client is expected to generate another access token using the same HTTP call shown above.
access_token
as the Bearer token in the authorization
header:
curl --location --request GET '${fabric Endpoint Url}/v1/product' \ --header 'accept: application/json' \ --header 'authorization: Bearer ${access_token}' \ --header 'cache-control: no-cache' \