Can an order have multiple discount applications?

Solved
Shopify Partner
22 0 3

Can an order have multiple discount applications?

 

As far as I understand only a discount code can be applied to any order.

Is that the case for discount applications as well?

 

What scenarios could lead to multiple applications on a single order?

0 Likes
Shopify Staff
Shopify Staff
1552 77 232

discount_applications are applied on the checkout/order level and as you suspect, a checkout can only have one at a time. You might see multiple discounts on some orders on the line item level, which typically happens through POS (but these are not discount codes). Those will appear on the variant level, not on the top order level.

Cheers.

0 Likes
Shopify Partner
22 0 3

But the example in the documentation shows 3 applications.

See https://help.shopify.com/en/api/reference/orders/order#discount-applications-property-2019-07

Is that a valid?

0 Likes
Shopify Staff
Shopify Staff
1552 77 232

That was my mistake. discount_code discounts are applied to the order level, even if the discount code targets line items. manual and script can target specific line items.

0 Likes
Highlighted
Shopify Partner
22 0 3

I think I wasn't very clear earlier sorry.

Let me try to rephrase my question.

There are actually 2 separate questions, although related.

 

1) Is it ever possible for the order.discount_codes[] array to have more than 1 element in it?

As far as I know, there can only ever be a single discount code applied to an order. But then why is it an array?

 

2) Is it ever possible for the order.discount_applications[] array to have more than 1 element in it?

My understanding is that automatic discounts cannot be combined with a discount code.

But is it possible to have a discount code (type = 'discount_code') or automatic discount (type = 'automatic'), combined with additional discount_applications of type 'manual' or 'script' or other?

I would image it is, otherwise why would discount_applications[] be an array?

 

I hope this clarifies the question.

1 Like

Success.

Shopify Staff
Shopify Staff
1552 77 232

Thanks for clarifying.

 

  1. At this time, it will only ever have one item. This was designed as an array way back (I'm told) and didn't grow into housing multiple codes, The discountCode field in GraphQL was designed to show one code as a string to contrast.
  2. It is possible to see more than one element in an Order.discount_applications array. As an example, if I start an order  Shopify POS, manually discount a line item and apply a discount code to the cart, the resulting order will have both a manual discount_application and a discount_code discount_application. Automatic discounts show up with the type automatic here too if they are applied alongside types of manual, script, and discount_code.

Let me know if that makes sense.

 

Cheers.

0 Likes
Shopify Partner
22 0 3

Yes, totally makes sense.

Thank you!

0 Likes