Flow automation for Dealer Prices vs MSRP - NEED HELP!

Im trying to create an internal system in Shopify where, when I create a draft order with a customer tagged as “Dealer”, that draft order populates the Dealer cost of the product, not the MSRP. I know you can’t overwrite a draft order line item ( Product ), so I’m trying to figure out how to apply a discount once draft is created. Need help with that specific part as thats the only missing link to this.

Step by Step process:

  • Created metafields and established it as an amount. Label that metafield as “Dealer price” and set the numbers in for each variant.

  • In Flow, where most of this is done, I have it to where when a draft is created, it checks customer tags. If customer tag comes back as “Dealer”, it then checks each “Line item”, searches for the metafield value I stated above, and outputs that value as a log.

  • Next, it gets the original MSRP and maths the difference ( So now I have the price that should be applied as a discount ). It all outputs as a log so I should be able to pull that final number, have Flow apply that discount number, to give the correct Dealer price for each line item.

Again, the “Applying discount to line item” is where I am stuck Need help on this if anyone has insight. I’m ok with code but its been AWHILE since I did anything like this.