Product Sync
Trigger
app.apiServer.post('/webhooks/article-update', async (req, res) =>
{
res.status(200).send({ success: true });
const { entityId } = req.body;
await addToQueue('article.sync', entityId);
});Fetching Article Data
const ErpApi = require('@vario-software/vario-app-framework-backend/api/ErpApi');
async function fetchArticle(articleId, salesChannelId)
{
const { data } = await ErpApi.vql(
`SELECT
id,
articleNumber,
sku,
active,
descriptions.description,
descriptions.longDescription,
descriptions.languageCode.isoAlpha2,
weight,
ean
FROM article.queryArticles
WHERE id = '${articleId}'`,
{},
1
);
return data[0] || null;
}Including Custom Fields
Fetching Variants
Transforming Data
ERP Field
Common Platform Field
Notes
Handling Multiple Languages
Handling Categories
Pushing to the Platform
Image Sync
Create vs. Update
Error Handling
Error
Cause
Resolution
Last updated
Was this helpful?