I am passing data from shopify to fivetran and want to get the discount for each line item in an order.
However, the documentation for order > line_items > total_discount states
This field must be explicitly set using draft orders, Shopify scripts, or the API. Instead of using this field, Shopify recommends using discount_allocations, which provides the same information.
So I wanted to use Shopify flow to add a discount to the line item.
Here is the flow I created.
Run Code
orderEditAddLineItemDiscount
Error contents at runtime
I’m assuming the highlighted area is the cause of the error
I’m assuming the lineItemId is in the format “gid://shopify/CalculatedLineItem/121314” or something like that.
How can I get the id of this CalculatedLineItem?
Or let me know if there is another way.
Thank you in advance.



