web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

Shopify Connector: Separating Line Discount and Order Discount for BOM Items in Business Central

(3) ShareShare
ReportReport
Posted on by 67

Hi Everyone,

I am working on a customization involving the standard Shopify Connector in Dynamics 365 Business Central and would like to know if anyone has encountered a similar scenario or if there is a standard approach that I might be overlooking.

Environment


  • Business Central: 28.2

  • Standard Microsoft Shopify Connector

  • Sales Orders are automatically posted after synchronization.

  • Some products are BOM/Assembly items that are exploded into child Sales Lines before posting.

  •  

Current Behavior

When a Shopify order is synchronized, both the Shopify line-level discount and the Shopify order-level (cart) discount are combined and imported as a Line Discount on the Sales Line.

This appears to be the standard behavior of the Shopify connector.

The Problem

The issue occurs when a BOM item is exploded.

For example:


  • Kit Item: $100

  • Shopify Line Discount: $10

  • Shopify Order Discount: $5

  •  

The connector imports the combined discount ($15) as a Sales Line Discount.

When the BOM is exploded:


  • The parent line is replaced by child lines.

  • The original line discount information is lost.

  • The resulting document total no longer matches the amount already paid by the customer in Shopify.

  •  

Proposed Solution

Our client has requested that the discounts be separated as follows:


  • Shopify Item/Line Discount → Business Central Line Discount

  • Shopify Order/Cart Discount → Business Central Invoice Discount

  •  

To achieve this, my approach is:


  1. Read the original Shopify order data stored in Shpfy Data Capture.

  2. Extract the actual line-level discount and order-level discount separately.

  3. Update the Sales Lines with only the line discount.

  4. Allow the BOM explosion to occur.

  5. Calculate and apply the Invoice Discount on the Sales Order.

  6. Validate that the final Sales Order total matches the Shopify payment before automatic posting.

  7.  

My Questions


  1. Is there any standard functionality in the Microsoft Shopify Connector that already separates line discounts and order discounts, or is parsing the stored Shopify JSON the only practical approach?

  2. Has anyone implemented a similar customization for BOM/Assembly items where preserving the distinction between line discounts and order discounts was required?

  3. Are there any known pitfalls or upgrade concerns with modifying discounts after Shopify synchronization but before the Sales Order is automatically posted?

  4.  

Any guidance or recommendations would be greatly appreciated.

Thank you!

I have the same question (0)
  • Suggested answer
    Grigorios Mavrogeorgis Profile Picture
    3,055 Super User 2026 Season 2 on at
    Hi,
    I would look at this as an interaction between how the connector maps the discount and what Explode BOM does afterwards, rather than one or the other being at fault. The connector puts the combined discount on the parent line, then the explosion clears that line and inserts fresh component lines that get priced from normal sales price and discount logic, so the value the connector wrote is not carried down.
    On your proposed split, be careful with the invoice discount side. It is not simply parked safely on the header, BC allocates the invoice discount across eligible lines, so an explosion or any later recalculation can move it around. Worth testing what your total looks like after posting, not just after import.
    For the line discount you would need to capture it before the explosion and spread it across the children proportionally, and then handle rounding so the document still ties to what Shopify actually collected.
    Is the explosion happening automatically in your flow, or is someone doing it manually before posting?
     
    Glad to help - follow up if anything is unclear.  
    ►  If this solved it, marking it verified helps others too.      
    Regards,
    Grigorios Mavrogeorgis
    Business Central Consultant & AL Developer

    Work: Gmsoft Limited
    Blog:  insidebusinesscentral
    LinkedIn: linkedin.com/in/gregorymavrogeorgis

     
  • Suggested answer
    YUN ZHU Profile Picture
    102,765 Super User 2026 Season 2 on at
    It looks like you need to add a new field to store the original price from Shopify, and then compare it for consistency during posting.
     
    Thanks.
    ZHU
  • Suggested answer
    OussamaSabbouh Profile Picture
    18,722 Super User 2026 Season 2 on at
    Hello,
    There is no documented standard Shopify Connector setup that maps Shopify line discounts separately to Sales Line Discount and cart/order discounts to Invoice Discount; the connector normally transfers the Shopify-calculated discount into the generated sales lines. Your approach is valid, but avoid depending directly on the internal Shopify Data Capture JSON where possible because Microsoft keeps staging and communication logic private so it can change with Shopify API updates. The safer design is to create a dependent extension and use the published Shpfy Order Events before/after the sales document and lines are created: store the cart discount in your own field, leave only the true item discount on the parent line, explode the assembly, then apply the cart discount across the final document and validate the BC total against the Shopify order total before release/posting. During implementation, disable automatic release/posting until the validation succeeds. Also handle tax-inclusive pricing, rounding, multiple currencies, refunds, and discount allocation across several lines, as these are the main areas where totals can differ after the BOM explosion.
    Regards,
    Oussama Sabbouh
  • Gerardo Rentería García Profile Picture
    27,611 Super User 2026 Season 2 on at

    Hi, good day
    I hope this can help you, and give you some hints.

    Solved: Shopify Connector – Syncing Custom Fields to Metafields

    Best Regards
    Gerardo

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 575 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 430 Super User 2026 Season 2

#3
Grigorios Mavrogeorgis Profile Picture

Grigorios Mavrogeorgis 334 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans