Appearance
Inventory Webhook Notification
The Inventory Webhook Notification from MyLION provides you with updates about changes in inventory levels for specific products. This enables you to maintain accurate and up-to-date inventory information within your application. Below, you'll find details about the payload structure of the notification and how to set up your receiving endpoint to process these inventory updates.
Payload Structure
When an inventory update event occurs within the MyLION ERP system, a webhook notification is sent to your designated endpoint. The payload of this notification follows this structure:
json
{
"inventories": [
{
"myLionId": 12345678,
"externalId": "extId",
"stock": 1.24,
"manufacturingQuantity": 5.3,
}
]
}inventories: An array of inventory updates.myLionId: The unique identifier of the product within MyLION.externalId: Your external identifier for the product.stock: The current inventory stock level for the product.manufacturingQuantity: The current manufacturing quantity for the product.
Receiving Endpoint
To process the Inventory Webhook Notification from MyLION, you need to set up a receiving endpoint in your application. The endpoint URL should follow this format:
bash
https://<your_base_url>/rest/mylion/v1/inventoryWhen MyLION sends a webhook notification, it will make a POST request to the specified endpoint with the payload containing the updated inventory information. The expected response is HTTP OK (200), no payload.
Processing the Notification
Upon receiving the webhook notification, you can process the payload to update the inventory levels in your application's database or system. You should validate the authenticity of the incoming request using the webhook authentication method previously outlined to ensure the data's integrity.