Skip to main content

Magento 2 - Data Mapping & Synchronisation

A comprehensive technical guide to the Magento 2 integration. Covers synchronisation schedules, stock level configuration options, and detailed field mappings for products and sales orders.

Ricardo Guerreiro avatar
Written by Ricardo Guerreiro
Updated yesterday

πŸ”— Magento 2: Data Mapping & Synchronisation

This guide details the data flow between Magento 2 and Optiply. It includes the exact synchronisation schedule, configurable backend variables, and specific field mapping logic.

⏱️ Synchronisation General Board

The following table outlines the data entities and their update frequency.

Entity

Direction

Frequency

Notes

Products

Magento β†’ Optiply

Every 30 min

-

Product Deletions

Magento β†’ Optiply

Once a day (*1)

-

Stocks

Magento β†’ Optiply

Every 30 min

-

Sell Orders

Magento β†’ Optiply

Every 30 min

-

(*1) Product Deletion Logic:

Deleted products are not retrieved directly from Magento. Instead, we run a Products Full Sync once a day to cross-reference which products are currently enabled in Optiply but no longer exist in the Magento feed.


βš™οΈ Options and Features (Configuration)

The following settings are available to customise the integration logic. These options are not visible in the front-end. Please contact Customer Support to adjust these variables.

1. Enable/Disable Stock Level Sync

  • Variable: map_stockLevel (Default: true)

  • Description: This option allows you to decide if Optiply should sync the stockLevel from Magento.

  • Use Case: Some customers use third-party applications or direct syncs to the Optiply API to manage their stock levels. In these cases, you may want to disable the incoming stock sync from Magento to prevent overwriting your data.

2. Warehouse Filtering (Stock)

  • Description: You can set up a specific list of Warehouse IDs.

  • Logic:

    • If provided: We pull stock only from the listed Warehouse IDs and sum them.

    • If empty: We retrieve and sum the stock from all warehouses.

3. Sell Order Status Sync

  • Default: We only pull Completed Sell Orders.

  • Option: You can decide to sync All Order Statuses if needed (e.g., to see pending or processing orders).


πŸ—ΊοΈ Data Mapping Details

1. Products

Source Endpoint: {store_url}/rest/V1/inventory/source-items

Optiply

Magento

Logic / Notes

Name

name

-

SKU Code

sku

-

Article Code

id

-

Price

price

-

Unlimited Stock

product.type_id

β€’ IF product.type_id = 'simple' β†’ unlimitedStock = FALSE.

β€’ OTHERWISE β†’ unlimitedStock = TRUE.

Stock Level

qty

Warehouse Logic: Summed from all warehouses unless a specific list of WarehouseIDs is provided.

Status

status

β€’ IF status = 1 β†’ Enabled.

β€’ IF status = 2 β†’ Disabled.

2. Sell Orders

Optiply

Magento

Notes

Total Value

subtotal

-

Placed Date

created_at

-

Completed Date

updated_at

-

Sell Order ID

increment_id

-

Remote ID

identity_id

-

⚠️ Limitation: No Order Updates

We do not sync order changes in any way.

  • Order line changes

  • Line deletions

  • New lines added to existing orders

These updates will not be reflected in Optiply after the initial sync.

3. Sell Order Lines

Optiply

Magento

Product ID

product_id

Quantity

qty_ordered

Subtotal Value

base_row_total


4. Purchase Orders (Important Limitation)

Magento 2 does not natively support Purchase Orders.

  • No Export: When you place a Purchase Order (PO) in Optiply, it is not transferred to Magento.

  • Receipts: You must close Purchase Orders directly in Optiply upon receipt.

    • Navigate to Purchasing β†’ Today's & Overdue Orders.

    • Partial Deliveries: Even if you only receive part of an order, it is critical to enter this in Optiply immediately. This ensures your stock levels in Optiply remain accurate and aligned with your physical inventory.

5. Backorders & Negative Stock

Optiply can automatically prioritise ordering stock for items that are already sold (backorders). We detect this based on negative stock levels.

To ensure Magento 2 correctly reports negative stock to Optiply, you must configure the following settings in your Magento Admin Panel:

  1. Out-of-Stock Threshold: Set this value to 0.

  2. Backorders: Set this to Allow Qty Below 0 (Allow Backorders).

Why is this necessary?

If Magento stops counting stock at 0, Optiply cannot see how many customers are waiting. By allowing negative values (e.g., -5), Optiply knows you need to order 5 units just to fulfil existing demand, plus whatever you need for future sales.
​


❓ Frequently Asked Questions (FAQs)

Why is my product status wrong?

We map the status strictly based on the Magento status code: 1 is Enabled, and 2 is Disabled. If your products are disabled in Optiply, check if their status in Magento is set to 2.

Why are my complex products (Configurable/Bundle) showing as "Unlimited Stock"?

Optiply's logic checks the product.type_id. If it is not 'simple' (e.g., it is a configurable or bundle parent), we assume unlimitedStock = TRUE because the actual inventory is usually held on the child ('simple') products associated with it.

Can I sync pending orders?

Yes. By default, we only sync "Completed" orders. If you wish to see all orders regardless of status, please contact Support to change your configuration to "Sync All Order Status."

Why do deleted products take up to 24 hours to disappear?

Magento does not send a specific "deleted" signal. We rely on a Products Full Sync, which runs once a day to compare your current Magento catalogue against Optiply and identify missing items.

Did this answer your question?