Shopify discounts not writing to line items in backend tables

rsonni
New Member
2 0 0

Our Shopify store is connected to our ERP via API, and our ERP is the de-facto source of reporting for our company. We have several promotions run via the Script Editor, and on these orders the discounts get written at the line item level (and our ERP sees it as such). But when using a default Shopify discount, our ERP does not see a line item discount. Instead, the discount is applied to the entire order and we can't accurately tell which items received the discount. This even happens when we specify products for the coupon code. We've been told by Shopify support that this is expected behavior. Since a coupon code can apply to a whole order, it does not attribute discounts to individual line items in the backend. In terms of analytics, this makes things very difficult for us. We often need to analyze a SKU's performance/profitability when making business decisions, and the missing discounts mean we have no way of knowing an item's true net profit.

This is a snippet of the JSON from one of our orders that uses a Script Editor discount:

"discount_applications":[{"type":"script","value":"21.96","value_type":"fixed_amount","allocation_method":"one","target_selection":"explicit","target_type":"line_item","title":"4 for $10","description":"4 for $10"}]

 And a snippet from the line item of that Script Editor discount:

product_exists":true,"fulfillable_quantity":4,"grams":68,"price":"7.99","total_discount":"21.96"

Here's a snippet from an order that uses a Shopify coupon code that targets a specific product we sell:

[{"type":"discount_code","value":"25.0","value_type":"percentage","allocation_method":"across","target_selection":"entitled","target_type":"line_item","code":"MAGIC25"}]

 And a snippet of the line item for that discount:

product_exists":true,"fulfillable_quantity":0,"grams":93,"price":"6.99","total_discount":"0.00"

Why is the admin page for this order able to show me what was discounted line by line but the backend tables do not? How can we make this cooperate with our ERP so that we see accurate discounting at the line item level? Can we change the allocation method for a coupon code?

Before it is suggested, using the Script Editor for all our discounts is not a viable solution.

0 Likes
rsonni
New Member
2 0 0

Bumping this.

0 Likes