Price Sync

Price sync pushes product price updates from VARIO ERP to the external platform. This ensures customers always see current pricing.

Trigger

Price sync is triggered by the article-price.update webhook:

app.apiServer.post('/webhooks/price-update', async (req, res) =>
{
  res.status(200).send({ success: true });

  const { entityId } = req.body;
  await addToQueue('price.sync', entityId);
});

Fetching Price Data

Query price information from the ERP using VQL:

const ErpApi = require('@vario-software/vario-app-framework-backend/api/ErpApi');

async function fetchPrices(articleId)
{
  const { data } = await ErpApi.vql(
    `SELECT
       id,
       articleNumber,
       articlePrices.salesPrice,
       articlePrices.currencyCode,
       articlePrices.priceGroup.label
     FROM article.queryArticles
     WHERE id = '${articleId}'`,
    {},
    1
  );

  return data[0] || null;
}

Price Concepts

VARIO ERP supports several pricing concepts that you may need to map to the platform:

Base Price

The standard sales price for an article. This is the most common price to sync.

Customer Group Prices

Different prices for different customer groups (e.g., wholesale, retail, VIP). If the platform supports customer group pricing, map the ERP price groups to platform customer groups.

Tiered Prices (Quantity Breaks)

Prices that change based on the quantity ordered (e.g., 1-9 units at full price, 10+ at a discount). If the platform supports quantity-based pricing, include the tiers in your sync.

Currency

Prices are always associated with a currency. If the platform operates in a different currency than the ERP, you need to either:

  • Sync in the ERP currency and let the platform handle conversion

  • Convert prices before pushing, using exchange rates from the ERP or an external source

Transforming Prices

Map ERP pricing to the platform's expected format. Key decisions:

Consideration
Options

Gross vs. Net

Some platforms expect prices including tax, others excluding tax

Tax rate inclusion

Send the tax rate alongside the price, or let the platform determine it

Rounding

Apply rounding rules before pushing (platform may have its own rules)

Compare-at price

Some platforms support a "compare at" or "was" price for showing discounts

Pushing to the Platform

Syncing with Product Sync

Price changes often coincide with product updates. Depending on the platform:

  • Combined sync — Some platforms expect price data as part of the product update. In this case, price sync and product sync share the same API call.

  • Separate sync — Other platforms have dedicated price endpoints. In this case, price sync operates independently.

If prices are part of the product payload on your platform, you can handle price updates within the product sync flow and skip a separate price sync entirely.

Last updated

Was this helpful?