π 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 =
disabledifLogic4.productStatusIdis inprod_disabled_statusIds.Status =
disabledifLogic4.IsVisibleOnWebShopdoes not match the custom flag settings.Otherwise, Status =
enabled.
2. Products: WebShop Visibility Mapping
Variable:
IsVisibleOnWebShop(Default:true)Description: Determines if
Logic4.IsVisibleOnWebShop: falseshould 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 tofalse).
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_notBeingBoughtis set totrue.
6. Supplier Products: Price Source
Variable:
map_purchase_priceDescription: Choose the source field for purchase prices:
Products.BuyPriceSupplierProducts.CreditorBuyPriceDo 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 tofalseif 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 tofalseif 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
BranchIdwhere 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 |
| Concatenated. |
SKU Code |
| - |
Article Code |
| - |
Price |
| - |
Unlimited Stock | "False" | Always defaults to false. |
Stock Level |
| Can be filtered by |
Status | Calculated | See Backend Options 1 & 2. |
Not Being Bought | Calculated | See Backend Options 4 & 5. |
EAN Code |
| - |
Created At |
| - |
Assembled |
| If either is |
2. Suppliers
Optiply | Logic4 |
Name |
|
Remote ID |
|
3. Supplier Products
Optiply | Logic4 | Logic / Notes |
Name |
| - |
Price |
| Controlled by If
If multiple Creditor prices exist, we map the first one. |
webshop_product_Id | optiplyProductId (from Optiply) |
|
SKU Code |
| - |
Status |
| If Else β Enabled. |
supplierId | optiplySupplierId (from Optiply) |
|
Preferred |
| If |
Lot Size |
| Mapped if |
MOQ |
| Mapped if |
Article Code |
| - |
EAN Code |
| - |
4. Sell Orders
Endpoint: /Orders/GetInvoices
We sync Invoices to capture direct sales without orders.
Filter: We only retrieve invoices where
InvoiceBelongsToOrderNumberis Null.
Optiply | Logic4 |
Total Value |
|
Placed Date |
|
Completed |
|
Sell Order ID |
|
Remote ID |
|
5. Sell Order Lines
Optiply | Logic4 |
productId | ProductId |
quantity | Qty |
subtotalValue | NettPrice |
6. Buy Orders (Optiply β Logic4)
Optiply | Logic4 | Notes |
Placed Date |
| - |
Optiply ID |
| Mapped as |
Supplier ID |
| - |
Branch |
| Mapped from |
7. Buy Order Lines - (Optiply β Logic4)
Optiply | Logic4 |
product.articleCode |
|
quantity |
|
quantity |
|
placed |
|
expectedDeliveryDate |
|
8. Buy Orders (Logic4 β Optiply)
Optiply | Logic4 | Logic |
Remote ID |
| - |
Total Value | 0 | - |
Completed |
| If
Logic4 does not provide a specific completion date. |
9. Buy Order Lines - (Logic4 β Optiply)
Optiply | Logic4 |
quantity |
|
buyOrderLineRemoteId |
|
subtotalValue |
|
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 |
|
Occurred |
|
Remote ID |
|
Method B: Old Data (Pre-27/06/2025)
Calculation based on Sell_Order_Lines
Optiply | Logic4 |
Quantity |
|
Occurred |
|
Remote ID | Concatenation: |
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.
