To use the Avasam API to integrate with your seller account, you must first create an API key
If you need to create a new key, and have not created one previously
- Click on settings.
- Select the user management option.
- Click the API keys button in top right corner of the screen.
- If you cannot see the consumer key and secret key fields, click on the eye icons to reveal them.
- Click on the generate key button.
- You will be returned to the user list.
- Copy the consumer key and secret key fields for use in API calls.
- Click on the user name to open the details of the account including API details.
- You can control the rights given by apps using the API keys, in the access rights section.
- By default the system will assign basic rights. You can turn rights on or off to match the needs for your usage.
- Click save if you make any changes to apply them.
If you need to use webhooks with an API key
- Create a key using the above method if you haven't done so already.
- Click on the account user name to open the account details.
- Scroll down to the webhook section.
- Enter the verification token.
- Enter the stock update endpoint location and click test to verify. This is the location Avasam will send stock update notifications to for your sourced products when their stock levels change.
- If an error is returned, please check the location you have entered is correct before clicking test again.
- Enter the price update endpoint location and click test to verify.
- If an error is returned, please check the location you have entered is correct before clicking test again.
- Click save to apply the updated configuration.
Verification token: You can create a JWT token to verify requests.
You can verify a request using the Request ID in the request and the Request ID in the JWT payload.
Request body: (Content type: Application/json)
{
requestId:string (Request id for verify jwt data is correct or not),
on: DateTime (UTC request sent time),
token:string (jwt token created using verification token provided in configuration)
data:[ (List of products which stock has change)
{
sku:string (Product sku),
quantity:int (New product quantity),
updatedOn:DateTime (When stock updated)
}
]
}
Response body: 200 (OK)
When you receive this notification you need to acknowledge it using the Avasam API:
api-seller/Product/AcknowledgeStockUpdate