Hi all,
Im having a bit of trouble with getting the discounted price of a line item of an order. By discounted price I mean the effective price the customer actually pays for each unit. There are a couple different fields available, and what I want is the real discounted per unit price after all discounts have been applied, the price that the customer would actually pay and see on the invoice.
According to the documentation
discountedUnitPriceAfterAllDiscountsSet:
The approximate unit price of the line item in shop and presentment currencies. This value includes discounts applied to refunded and removed quantities.
discountedUnitPriceSet:
The approximate unit price of the line item in shop and presentment currencies. This value includes line-level discounts and discounts applied to refunded and removed quantities. It doesn’t include order-level or code-based discounts.
So to me the discountedUnitPriceAfterAllDiscountsSet should be in all cases contain the “most” discounted value and thereby be the “real” price that is also displayed on the invoice. However this doesnt’ always appear to be the case.
"lineItem": {
"sku": "01.097287",
"discountedUnitPriceAfterAllDiscountsSet": {
"presentmentMoney": {
"amount": "10.97"
}
},
"discountedUnitPriceSet": {
"presentmentMoney": {
"amount": "10.96"
}
},
"originalUnitPriceSet": {
"presentmentMoney": {
"amount": "12.9"
}
}
}
How can it be that in this case the discountedUnitPriceAfterAllDiscountsSet is greater than the discountedUnitPriceSet, worse still the invoice shows the 10.96 price instead of the 10.97 price?
This of course makes it a bit difficult to figure out whats going on and to ensure that in the end the two totals match.
Cheers
Gary