Why am I seeing mismatched values in Shopify discount fields?

Why am I seeing mismatched values in Shopify discount fields?

rohitmartires14
Visitor
3 0 0

Hey I've been polling shopify orders for my app, i noticed some value mismatches in the discount fields 

for e.g. 

case 1: the lineItem will have total_discount  as 0 but it will have discount_allocations array with some discount item (the docs do recomend using discount_allocations so is it fine if i use this as the discount source ) 

case 2: the order will have a object in discount_application with allocation_method as "accross" and target_selection as "all"  with a non zero discount, then when i check the discount_allocations in lineItem it will show a object but it will have amount as 0


is there something i'm missing ?

Reply 1 (1)

rohitmartires14
Visitor
3 0 0

Okay got it case 2 is because there was already a discount that reduced the price to 0 so i'm guessing after this no other discount is applied,

sill if anyone can outline how the discount system works would help a lot thanks