Stock Sync
Trigger
app.apiServer.post('/webhooks/stock-update', async (req, res) =>
{
res.status(200).send({ success: true });
const { entityId } = req.body;
await addToQueue('stock.sync', entityId);
});Fetching Stock Data
const ErpApi = require('@vario-software/vario-app-framework-backend/api/ErpApi');
async function fetchStock(articleId)
{
const { data } = await ErpApi.vql(
`SELECT
id,
articleNumber,
stock.available,
stock.physical,
stock.reserved
FROM article.queryArticles
WHERE id = '${articleId}'`,
{},
1
);
return data[0] || null;
}Stock Types
Stock Type
Description
Multi-Location Stock
Pushing to the Platform
Stock Buffers
Frequency Considerations
Handling Variants
Next Steps
Was this helpful?