For the complete documentation index, see llms.txt. This page is also available as Markdown.

Your First Shop App

This tutorial walks through the shop-specific setup: creating a sales channel, registering webhooks, and defining EAV groups. It assumes you already have a working VARIO Cloud app.

1. Set Up the Migration

The migration runs on first install. It creates the sales channel backend, a default channel, EAV groups, and webhooks.

// api/services/maintenance/install/migrations/1/index.js
const MigratorErp = require('vario-app-framework/backend/utils/migrator.js');

const eavGroupShop = require('./static/erp/eav-groups/myShop.json');

const handle = async function ()
{
  const migratorErp = new MigratorErp('migration1');

  // ERP-level: EAV groups for article listings
  await migratorErp.setMigration('eavStructureErp', async (methods) =>
  {
    await methods.createEavGroup(eavGroupShop);
  });

  // ERP-level: sales channel
  await migratorErp.setMigration('salesChannel', async (methods) =>
  {
    const backend = await methods.createSalesChannelBackend('My Shop', ['ECOMMERCE']);
    await methods.createSalesChannel(backend, 'My Shop', '', 'ECOMMERCE');
    await methods.activateSalesChannelBackend(backend);
  });

  // ERP-level: webhooks
  await migratorErp.setMigration('webhooks', async (methods) =>
  {
    await methods.registerWebhook(
      'sales_channel.create',
      '/api/webhooks/sales_channel.create',
    );
    await methods.registerWebhook(
      'sales_channel.delete',
      '/api/webhooks/sales_channel.delete',
    );
  });

  // App-level: cron webhooks (destinationOwner = 'APP')
  await migratorErp.setMigration('cronWebhooks', async (methods) =>
  {
    await methods.registerWebhook(
      'ORDER_IMPORT',
      '/api/cron-webhooks/ORDER_IMPORT',
      'APP',
    );
    await methods.registerWebhook(
      'PROCESS_QUEUES',
      '/api/cron-webhooks/PROCESS_QUEUES',
      'APP',
    );
  });
};

module.exports = { handle };

Use MigratorErp (from vario-app-framework) for ERP-level operations like sales channels, EAV groups, and webhooks.

2. Define the Shop EAV Group

Adds custom fields to article listings to store the external platform ID.

3. Query Articles via VQL

Use VQL to fetch article data including your custom fields:

Next Steps

  • Core Concepts — sales channels, webhooks, data flow, and queue processing

  • Integrations — inbound and outbound sync patterns

  • Configuration — per-channel parameters and transfer toggles

Last updated

Was this helpful?