An API to generate access tokens, which are used to authorise any other API requests made to Setu.
💡 Since this API is used to generate the Bearer Token the authorisation header shouldn’t be included in the API call. The Content-Type should still be included in the the header
💡 accessToken is are valid for 7 days.
How to use the access token
Once you have a valid token available against product configuration(s), you can store it and use it to authorise an API call made to Setu, by setting the authorization request header as Bearer <token-value>.
Implement a workflow to generate new token when the old one expires. The general setup might look something like this—
Store clientID and secret.
Generate new token with stored clientID and secret when token has expired. If the API you call returns 401 unauthorized, it could be an indication that the token has expired.
Store the newly generated token and use for subsequent API calls.
It is recommended that the entity integrating with this API collection follows the below prescribed integration flow as all APIs aren't mandatory for a successful integration.
Integrate with APIs in the following order (you can choose to integrate with only the ones marked mandatory)—
Create a seller
Get details of a seller
Update details for a seller
Delete a seller
Create a storefront for a seller
Get details of a storefront
Update details for a storefront
Delete a storefront
Add / update catalogue items for a storefront
Delete catalogue items
Update Inventory API
Get orders for a storefront
Update orders for a storefront
This GIF below illustrates a brief architecture of our system and the users engagement with the Client APIs -
In the following section we will discuss each of the APIs in more detail. We have populated each of the fields with sample data to give the reader a better feel of the actual requests and responses. Refer to the API reference to get a better understanding of all the possible values for each of the parameters.