Hello,
I am having trouble applying quantity based discounts to line items using the Orders API .NET SDK. Specifically, the issue I am having is that the quantity of the line item is not being factored in when calculating the line item’s applied discounts amount. Instead just the fixed amount of the discount is being applied, but I am expecting that it would be multiplied by the line item’s quantity. Let me explain.
I have setup the quantity based discount shown by the screenshot. If at least 6 items are purchased, then a $0.25 discount should be applied to each one.
When using the POS this discount works perfectly, that is, if I create an order with a line item for empanadas with a quantity of 6, a discount of $1.50 is applied to the line item, which is correct because 6 x $0.25 equals $1.50. But when I use the Orders API the applied discount for the same line item is only $0.25, even though the quantity of the line item is 6. Why would this be?
Here’s the code I am using to create the discounts for the order and the line items.
For the order I create the following:
new OrderLineItemDiscount(catalogObjectId: “XXX”, uid: “XXX”, scope: “LINE_ITEM”)
For the line item I create the following which reference the above OrderLineItemDiscount:
new OrderLineItemAppliedDiscount(discountUid: “XXX”)
But when I create the order, the resulting order object’s applied discounts for the line item is only $0.25 when I am expecting it to be $1.50.
What am I doing wrong? Thank you for your help