Mapping Strategies

Mapping is the process of translating entities between VARIO ERP and the external platform. Payment methods, shipping methods, customer groups, categories, and other entities rarely have the same identifiers or structures in both systems. A mapping configuration bridges this gap.

What Needs Mapping?

Entity
ERP Side
Platform Side

Payment methods

ERP payment method ID

Platform payment key (e.g., "credit_card", "paypal")

Shipping methods

ERP shipping method ID

Platform shipping key (e.g., "standard", "express")

Customer groups

ERP customer group ID

Platform customer group (e.g., "wholesale", "retail")

Categories

ERP category tree

Platform category/collection IDs

Tax rates

ERP tax rate IDs

Platform tax zone/rate IDs

Units

ERP unit codes

Platform unit labels

Languages

ERP language codes (ISO)

Platform locale codes

Currencies

ERP currency codes

Platform currency codes

Order statuses

ERP document statuses

Platform order statuses

Mapping Storage

Store mappings as structured data in an EAV group, scoped to the sales channel:

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

// Save a mapping
async function saveMapping(salesChannelId, mappingType, mappings)
{
  const groupKey = `my-shop-mappings-${salesChannelId}`;

  await ErpApi.eav.changeGroup(groupKey, (data) =>
  {
    data[mappingType] = mappings;
    return data;
  });
}

// Retrieve a mapping
async function getMapping(salesChannelId, mappingType)
{
  const groupKey = `my-shop-mappings-${salesChannelId}`;
  const group = await ErpApi.eav.getGroup(groupKey);

  return group?.data?.[mappingType] || [];
}

Mapping Data Structure

A mapping is typically an array of pairs linking ERP IDs to platform IDs:

Using Mappings in Sync

Order Import (Inbound)

When importing orders, resolve platform payment and shipping IDs to ERP IDs:

Product Sync (Outbound)

When syncing products to the platform, map ERP categories to platform categories:

Building a Mapping UI

Provide a settings page where users can configure mappings:

  1. Fetch options from both sides — Query ERP entities (payment methods, shipping methods, etc.) and platform entities

  2. Display side-by-side — Show ERP options on the left, platform options on the right

  3. Let users connect — Allow drag-and-drop or dropdown selection to create pairs

  4. Save the mapping — Store the mapping configuration for this sales channel

Fetching ERP Options

Fetching Platform Options

Category Mapping

Categories deserve special attention because they are hierarchical. ERP and platform may have completely different category trees.

Strategies:

  • Flat mapping — Map individual categories regardless of hierarchy. Simple but may lose structural information.

  • Tree mapping — Map parent categories and let children inherit. More complex but preserves structure.

  • Default category — Assign a default platform category for products that don't have a mapping. Prevents sync failures.

Fallback Values

For essential mappings (payment methods, shipping methods), define fallback values to prevent import failures when a mapping is missing:

Last updated

Was this helpful?