Skip to main content

Logic4 Data Mapping & Synchronisation

A comprehensive guide to the data flow between Logic4 and Optiply. Includes detailed mapping for products, suppliers, and orders, plus specific logic for "Direct Invoices" and the new receipt endpoint.

Ricardo Guerreiro avatar
Written by Ricardo Guerreiro
Updated this week

πŸ”— Logic4: Data Mapping & Synchronization

This guide details the data flow between Logic4 and Optiply. It includes the exact synchronisation schedule, a complete list of 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

Logic4 β†’ Optiply

Every 2 hours

-

Suppliers

Logic4 β†’ Optiply

Every 2 hours

-

Supplier Products

Logic4 β†’ Optiply

Every 2 hours

Deletions occur in every job due to bulk endpoint implementation.

Stocks

Logic4 β†’Optiply

Every 2 hours

-

Sell Orders

Logic4 β†’ Optiply

Every 2 hours

-

Buy Orders

Logic4 β†’ Optiply

Every 2 hours

-

Buy Orders (Export)

Optiply β†’ Logic4

Hourly

Runs at minute 10, 20, 30, 40, and 50.

Receipt Lines

Logic4 β†’ Optiply

Every 2 hours

-

⚠️ Important Sync Notes:

  • Interval Adjustments: The default schedule is every 2 hours. For "Big Shops" or shops with a large volume of open Buy Orders, we may need to increase this interval to prevent timeouts.

  • Rate Limits: Logic4 implements a rate limit of 200k calls per month per customer. We may need to adjust job frequency to ensure we stay within this limit.


βš™οΈ Options and Features (Backend 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 configure these specific variables for your tenant.

1. Products: Custom Status Mapping

  • Variable: prod_disabled_statusIds (Default: null)

  • Description: Define a list of Logic4 StatusIds that should strictly map to status=disabled in Optiply.

  • Logic:

    • Status = disabled if Logic4.productStatusId is in prod_disabled_statusIds.

    • Status = disabled if Logic4.IsVisibleOnWebShop does not match the custom flag settings.

    • Otherwise, Status = enabled.

2. Products: WebShop Visibility Mapping

  • Variable: IsVisibleOnWebShop (Default: true)

  • Description: Determines if Logic4.IsVisibleOnWebShop: false should be mapped as enabled in Optiply.

3. Products: Stock Warehouse Filter

  • Variable: stock_warehouse_ids (Default: null)

  • Description: Define a specific list of WarehouseIds from Logic4. Optiply will sum the stock only from these warehouses. If null, we sum the stock from all warehouses.

4. Products: Not Being Bought (Sync Toggle)

  • Variable: map_notBeingBought (Default: false)

  • Description: Decides if we sync the "Not Being Bought" attribute at all.

    • If false: Attribute is not mapped.

    • If true: Attribute is mapped (defaults to false).

5. Products: Not Being Bought (Status Logic)

  • Variable: notBeingBought_statusIds (Default: null)

  • Description: Define a list of StatusIds from Logic4 that should map to notBeingBought=true in Optiply.

    • Note: This is only applied if map_notBeingBought is set to true.

6. Supplier Products: Price Source

  • Variable: map_purchase_price

  • Description: Choose the source field for purchase prices:

    • Products.BuyPrice

    • SupplierProducts.CreditorBuyPrice

    • Do not map (None)

7. Supplier Products: MOQ Sync

  • Variable: map_MOQ (Default: true)

  • Description: Enable or disable syncing the Minimum Order Quantity (MinBuyAmount) from Logic4. Set to false if you want to manage MOQs manually in Optiply.

8. Supplier Products: Lot Size Sync

  • Variable: map_lotSize (Default: true)

  • Description: Enable or disable syncing the Lot Size (BuyCountIncrement) from Logic4. Set to false if you want to manage Lot Sizes manually in Optiply.

9. Sell Orders: Sync Invoices

  • Variable: sync_invoices (Default: false)

  • Description: Decide if we should sync Invoices from Logic4 (specifically used for Direct Sales with no associated order).

10. Sell Orders: Creation Status

  • Variable: sellorders_create_statusIds (Default: null)

  • Description: Define a specific list of StatusIds from Logic4 that trigger the creation of an order in Optiply.

11. Sell Orders: Deletion Status

  • Variable: sellorders_delete_statusIds (Default: null)

  • Description: Define a specific list of StatusIds from Logic4 that trigger the deletion of an order in Optiply.

12. Buy Orders: Export Branch

  • Variable: export_BranchId (Default: null)

  • Description: Define a specific BranchId where Buy Orders should be sent when exported from Optiply to Logic4.

13. Buy Orders: Send Created Date (Draft Mode)

  • Variable: send_OrderedOnDateByDistributor (Default: true)

  • Description: Decides if we send the OrderedOnDateByDistributor (Created Date) to Logic4.

    • If true: Order is sent with date.

    • If false: Order is sent without date. Consequence: The Buy Order appears in Logic4 as a Draft and requires manual approval.


πŸ—ΊοΈ Data Mapping Details

1. Products

Optiply

Logic4

Logic / Notes

Name

ProductName1 + ProductName2

Concatenated.

SKU Code

ProductCode

-

Article Code

ProductId

-

Price

SellPriceGross

-

Unlimited Stock

"False"

Always defaults to false.

Stock Level

FreeStock

Can be filtered by stock_warehouse_ids.

Status

Calculated

See Backend Options 1 & 2.

Not Being Bought

Calculated

See Backend Options 4 & 5.

EAN Code

BarCode1

-

Created At

DateTimeAdded

-

Assembled

IsComposedProduct / IsAssembledProduct

If either is true β†’ True.

2. Suppliers

Optiply

Logic4

Name

CompanyName

Remote ID

Id

3. Supplier Products

Optiply

Logic4

Logic / Notes

Name

ProductName1 + ProductName2

-

Price

BuyPrice or CreditorBuyPrice

Controlled by map_purchase_price option.
​

If CreditorBuyPrice is selected but null, we map BuyPrice.

If multiple Creditor prices exist, we map the first one.

webshop_product_Id

optiplyProductId (from Optiply)

SKU Code

CreditorProductCode

-

Status

Product.StatusId

If 1 or 10 β†’ Disabled.

Else β†’ Enabled.

supplierId

optiplySupplierId (from Optiply)

Preferred

IsActive

If true (on GetSuppliersForProduct) β†’ True.

Lot Size

BuyCountIncrement

Mapped if map_lotSize is true.

MOQ

MinBuyAmount

Mapped if map_MOQ is true.

Article Code

ProductId

-

EAN Code

Barcode1

-

4. Sell Orders

Endpoint: /Orders/GetInvoices

We sync Invoices to capture direct sales without orders.

  • Filter: We only retrieve invoices where InvoiceBelongsToOrderNumber is Null.

Optiply

Logic4

Total Value

AmountEx

Placed Date

CreationDate

Completed

CreationDate

Sell Order ID

SellOrderLine

Remote ID

Id

5. Sell Order Lines

Optiply

Logic4

productId

ProductId

quantity

Qty

subtotalValue

NettPrice

6. Buy Orders (Optiply β†’ Logic4)

Optiply

Logic4

Notes

Placed Date

CreatedAt

-

Optiply ID

remarks

Mapped as op-[OptiplyID] (e.g., op-12345).

Supplier ID

CreditorId

-

Branch

BranchId

Mapped from export_BranchId.

7. Buy Order Lines - (Optiply β†’ Logic4)

Optiply

Logic4

product.articleCode

ProductId

quantity

QtyToOrder

quantity

QtyToDeliver

placed

OrderedOnDateByDistributor

expectedDeliveryDate

ExpectedDeliveryDate

8. Buy Orders (Logic4 β†’ Optiply)

Optiply

Logic4

Logic

Remote ID

Id

-

Total Value

0

-

Completed

BuyOrderClosed

If true, we map the current timestamp now() as the completed date.

Logic4 does not provide a specific completion date.

9. Buy Order Lines - (Logic4 β†’ Optiply)

Optiply

Logic4

quantity

QtyToOrder

buyOrderLineRemoteId

BuyOrderRowId

subtotalValue

QtyToOrder * Price

expectedDeliveryDate

ExpectedDeliveryDate

7. Receipt Lines (Item Deliveries)

⚠️ CRITICAL: Two Data Methods

The logic for receipt lines depends on the date of the data.

Method A: New Data (Post-27/06/2025)

Endpoint: /BuyOrderDeliveries/GetBuyOrderDeliveries

Optiply

Logic4

Quantity

Records.Rows.Qty_Delivered

Occurred

Records.DateTimeProcessed

Remote ID

Records.Rows.Id

Method B: Old Data (Pre-27/06/2025)

Calculation based on Sell_Order_Lines

Optiply

Logic4

Quantity

QtyToOrder - QtyToDeliver

Occurred

now()

Remote ID

Concatenation: Logic4.BuyOrderId + Logic4.BuyOrderRowId + Logic4.ProductId

Note for Method B: Only one itemDelivery is created per line. We update the quantity incrementally as QtyToDeliver decreases.


❓ Frequently Asked Questions (FAQs)

Why do my Buy Orders appear as "Drafts" in Logic4?

This is controlled by the send_OrderedOnDateByDistributor variable. If this is set to false, we do not send the created date, which causes Logic4 to treat the order as a draft requiring manual approval. If you want them approved automatically, ask Support to set this variable to true.

Can I sync only specific warehouses?

Yes. Provide a list of WarehouseIds to Optiply Support, and we will configure the stock_warehouse_ids array. Optiply will then only sum stock from those specific locations.

Why are my receipts calculated differently for older orders?

Logic4 added a dedicated endpoint for deliveries on 27/06/2025. For any data before that date, we had to calculate receipts mathematically (Order - Deliver). For data after that date, we pull the exact delivery record from the new endpoint.

Why is the sync frequency limited?

Logic4 enforces a rate limit of 200,000 API calls per month. To ensure your shop stays online and within these limits, we default to a 2-hour sync interval. For very large shops, we may need to decrease the frequency further to avoid hitting this cap.

Did this answer your question?