Discount Applications exposes line level discounts on the Order API

Highlighted
Shopify Staff
Shopify Staff
257 1 63

Hi!

If you missed it at Unite this year, we've exposed line level discount information on the Order API with a new readable property: discount_applications.  Take a look at the updated Order API reference for all of the details.  This feature will enable more accurate accounting when discounts are involved in orders.

We look forward to seeing what features this enables, as always please leave questions and comments in the thread below.

Shopify Apps Team

Developer Experience @ Shopify
2 Likes
Shopify Expert
3841 0 270

Quick Question:

item.price is static as the variant price. Always has been. Always will be. 

item.price less the total of the item's discount_allocations amounts will be the subtotal for the item used for the purpose of taxes?

So if an item is subject to VAT, to know the true item price, we have to do the following:

add up all the discount_allocation amounts. Subtract that from the line item price. Now remove VAT and we would know the price of the item without taxes. 

Correct? In other words, we can do the math now to ensure when dealing with taxes and discounts, we know the whole story for line item pricing now?

 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes
New Member
16 0 0

add up all the discount_allocation amounts. Subtract that from the line item price. Now remove VAT and we would know the price of the item without taxes. 

Yes!

If the tax is included in the line item price, this is how you proceed to know the amount paid by the customer without taxes for the line item. 

(quantity * price) - sum of discount allocations - VAT

If the tax is not included, you simply substract the sum of discount_allocations amounts from the line item total price.

(quantity * price) - sum of discount allocations

Correct? In other words, we can do the math now to ensure when dealing with taxes and discounts, we know the whole story for line item pricing now?

Correct!

0 Likes
Shopify Expert
3841 0 270

Ahhh you do bring up an interesting point. Always ensure the line item price is multiplied by quantity as the subtotal there, since the discount allocations amounts will be applied not per line item, but per total quantity purchased of that line item. 

In other words, we do not have to worry that a discount was applied  to just **one** or **two** of a quantity of three purchased of a line item, we can safely assume that whatever the total of the discount allocations amounts to, that amount applies to the total quantity purchased. 

 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes
New Member
16 0 0

In other words, we do not have to worry that a discount was applied on just one or two of a quantity of three purchased of a line item, we can safely assume that whatever the total of the discount allocations amounts is, it applies to the total quantity purchased. 

Yes! In the case of BOGO discounts (e.g. buy 1 get 1 for free) which can apply on a specific quantity, we split the line items to apply the discount on the desired quantity.

0 Likes
Shopify Expert
3841 0 270

With Shops that use Avalara tax reporting, you have a line item called pre_tax_price which is calculated to ensure discounts are correctly applied to the retail price. 

Can we assume that this can now be ignored since Shopify reports discounting per line item? 

Again, in the name of cleaning up cruft, attributes like this will either be problematic or not depending on their value to the ecosystem. 

Custom Shopify Apps built just for you! hunkybill@gmail.com http://www.resistorsoftware.com
0 Likes
New Member
16 0 0

Can we assume that this can now be ignored since Shopify reports discounting per line item? 

Yes it can be ignored and we are planning on deprecating it. The same goes for the applied_discount attribute and applied_discounts on line items.

Again, in the name of cleaning up cruft, attributes like this will either be problematic or not depending on their value to the ecosystem. 

I could not agree more :)

0 Likes
Shopify Partner
17 0 3

HI All, 

Can we apply this line level discounts via API? if yes, how can we do that?

0 Likes
Shopify Staff
Shopify Staff
257 1 63

No, this is read only. Apply discounts the same way as before using PriceRule + Discount code APIs.

Developer Experience @ Shopify
0 Likes
Trailblazer
636 0 87

Hi there,

I just wanted to say that we are very happy with this change.

This allows us to compute much more accurate discounts, in particular when a price rule applies only to specific line items.

Thank you!

Clement

0 Likes