What's your biggest current challenge? Have your say in Community Polls along the right column.
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Re: Removing discount allocation method "one"

Removing discount allocation method "one"

Jason_Tigas
Shopify Staff (Retired)
28 0 18

TL;DR

As of API version 2020-07, we are updating the allocation methods available for explicit discounts. Currently explicit discounts are assigned an allocation method ofone as they apply to one line. With this change the allocation methods will now includeeach andacross, withone being deprecated. 

 

Context


Discounts currently have 3 types of allocation methods: across all lines (across), on each product (each), or on one line (one).

 

For example, imagine a checkout with two identical t-shirts, costing $10 each. Because they are the same product, they will be stored in a single line item, with a quantity of 2. Now, imagine we want to apply a $5 discount. This is how each value of allocation method would change the application of the discount:

 

  • With across, the discount would be applied on the final value of the line item. Since we have two t-shirts, each costing $10, that would amount to $20. Applying the discount, we'd have $20 - $5 = $15, meaning the final total price would be $15.
  • With each, the discount is applied on each product. In the example, we would first discount the product, meaning each product would cost $10 - $5 = $5 instead. Then, we would multiply that by the quantity, which is 2, giving us a final price of $10.
  • Finally, we have one.one is the exact same as across, except it also signals that the discount is an explicit discount - was applied on an explicit line only.

 

What does the change look like?
Currently, explicit discounts are always represented by allocation method one, and target_selection explicit

 

To know whether a discount targets a single line, target_selection parameter should be used where a value of explicit would be expected; instead of the allocation_method parameter with a value of one.

 

For discounts applied on a single line (explicit), an allocation_method value across means that the discount had the intention of being applied across a line item. If the quantity of products on the line changes, the discount applied across the line will not change. While a value of each means that the discount had the intention of being applied on each product of the line. Thus, should the quantity of the line change, the total discount amount applied on that line should as well.

To learn more visit the Shopify Help Center or the Community Blog.

Replies 58 (58)

Skylitech
Shopify Partner
9 0 5

Hi, 

We don't use any discount allocation features in our app. Even we don't use any type of discount on our app.

Still why I am seeing This

"The allocationMethod field on DiscountApplication for explicit discounts will now either be each, or across. The option for one has been removed" on my App API health Check. 

We don't find any discount feature in our app. We just collect the order in transfer to the CRM's. Our app is Skylio - CRM Connector.

See the below image.

Screenshot (304).png

Please provide some solution about tha.

Jason_Tigas
Shopify Staff (Retired)
28 0 18

Hi, this is an alert for a deprecation that "might" affect you. The change occurred on a return value which was included in the payload of one of the calls you made.

This message will go away when you update your calls to version 2020-07.

To learn more visit the Shopify Help Center or the Community Blog.

shopsync
Visitor
2 0 3

Hey @Jason_Tigas out of curiosity here - is there a way we can find the "exact" call that's being made from our application that you're giving us this notice about? Unless we're missing something - we can't seem to find the culprit that is making use of this value anywhere. We want to stay in compliance at all times / and up to speed on all changes being made but just need a little more help to find out what needs to be changed.

Thanks!

ShopSync

Jason_Tigas
Shopify Staff (Retired)
28 0 18

Sure will DM you!

To learn more visit the Shopify Help Center or the Community Blog.

ArchitechproOU
Shopify Partner
104 2 19

Hi @Jason_Tigas! We seem to have exactly the same problem as @Skylitech described. All requests were upgraded to be 2020-07 or just don't specify the version, so the latest version is used. We have tried to reach out to partner support with no chance to get any detailed info - is there a chance we can get more info about what's causing the warning in our particular case?

Jason_Tigas
Shopify Staff (Retired)
28 0 18

Hi @ArchitechproOU,

Actually, please read the following about not specifying the version.

If your request doesn't include a version, then the API also defaults to the oldest supported stable version. However, we do not recommend relying on this behaviour for adopting deprecated changes. As you update your app, you should specify the API version with every request. By making your app version aware, you anchor your code to a specific set of features that are guaranteed to behave in the same way for the supported timeframe.

 

 

To learn more visit the Shopify Help Center or the Community Blog.

ArchitechproOU
Shopify Partner
104 2 19

@Jason_Tigas thank you very much for the note! This should resolve the problem.

Akki
Shopify Partner
17 0 2

We are also getting this warning. We tried to upgrade all our API calls to 2021-01 but still getting this message. Is it possible for you to let us know which exact call is causing this issue?

Our App is Charge Me Later

vaadiorganics
Visitor
1 0 0

Hi @Jason_Tigas We seem to have exactly the same problem as @  described.

https://community.shopify.com/c/Shopify-APIs-SDKs/Removing-discount-allocation-method-quot-one-quot/...

we upgraded almost all our code for new version 2021-01, so we are unable to find the culprit call.

so please let me know whether there is  a way we can find the "exact" call that's being made from our application that you're giving us this notice about?

website:  https://vaadi-herbals-india.myshopify.com/

pvt app: shopify_api_21

any help would be highly appreciated.

devblue
Shopify Partner
5 0 1

@Jason_Tigas 

@stephers 

 

We checked our implementation and target_selection is not used anywhere.

API version is 2021-07, both client-side and in Webhook API version settings, but we're still seeing the warning for the "Order - Admin - REST" webhook as recently as 2021-07.

Is it possible to find the exact offending call from our application?

facturama
Visitor
1 0 0

Hey @Jason_Tigas I have the same problem as ShopSync, we already changed the calls to version 2020-10 but we still get this error and we can not identify exactly where is the detail, could you help me?

Thanks!

App: Facturama

email: norma@facturama.mx

dakachi
Visitor
1 0 0

Hi Jason, 

We updated our API call to 2021-01, but we still got the notice. Can you help ?

ZestardTech
Shopify Partner
5912 1068 1414

Hello Jason,

 

Could you kindly assist me in making it work. We are also not using any discount application still it is showing error on our app. 

Our app is Easy Donation. 

So, kindly let me know on it so that i can make the further changes and make it work. As the deadline given is 1st April so very less days are remaining to cover it up.

Want to modify or develop new app, Hire us.
If helpful then please Like and Accept Solution .
Email: support@zestard.com
Shopify Apps URL :- https://apps.shopify.com/partners/zestard-technologies
Custom Modifications Into Shopify Theme | Shopify Private App | SEO & Digital Marketing

Tierney_Inc__Ad
Shopify Partner
2 0 0

In Shopify when setting up a discount, how do you create a discount to be explicit?  This discount should be applied to only one item.  All the options I tried so far did not show the discount in the JSON as explicit.  

"discount_applications": [

                                             {  "type": "manual",

                                                            "value": "20.0",

                                                            "value_type": "percentage",

                                                            "allocation_method": "one",

                                                            "target_selection": "explicit",

                                                            "target_type": "line_item",

 

asoola
Tourist
14 0 1

We're getting the same alert.

I suspect its because we're using shopify-api-node library.
shopify-api-node --> index.ts
```

type AllocationMethod = 'across' | 'each' | 'one';

```

That lib needs to make the update on their end

emmahyde
Visitor
1 0 0

Hello, 
We are receiving this warning in our Ruby Shopify application (currently unlisted, plans to become listed shortly). I've upgraded the shopify gems we are dependent on to the newest versions: 

gem 'shopify_api', '9.3.0'
gem 'shopify_app', '17.0.5'

And I additionally have set our ShopifyApp version to:

ShopifyApp.configure do |config|
  config.api_version = "2020-07"
  ...
end

But we are still receiving this deprecation warning with respect to 

'orders/updated' -> Admin  Webhook

As far as I can tell, paths being used on the store end up being

{store_host_url}/admin/api/2020-07/{resource}

So we're really struggling tracing this down, as we appear to be fulfilling all of the requirements. Any help is appreciated.

Number one question I would like an answer to: how can I fully regenerate the schema? In trying to trace this down I saw that folks used to generate it by going to https://xxx.myshopify.com/admin/api/2020-04/graphql.json, but that appears to no longer work. Please let me know!

choonkeat
Shopify Partner
14 0 10
  1. I'm not using the discount allocation attribute from the webhook
  2. I don't necessarily have the accessToken to all shops to reregister my webhook with new 2020-07 version

Can Shopify admin just update all my webhooks' versions instead of "delisting my app from the Shopify App Store and block installation of my apps" ?

3ds1L
Visitor
1 0 0

Hey @Jason_Tigas 

Our app didn't use that return value in our draft order API.
We just updated our API version to '2020-07' but we're still getting the message.

Can you help us determine where those attributes get trigger on our app?

Thanks!

Website On-Demand

DonnaC
Shopify Partner
6 0 1

We are receiving this error with API 2020-07.

LAST DETECTED (UTC)
Mar 25, 2021 at 09:19 AM

We have code that refers to the discount allocations, but nothing in use.

The only relevant code segments, from functions which aren't being called, include:

'type': 'manual',
'title': 'custom discount',
'description': discount_message,
'value': discount_value,
'value_type': 'fixed_amount',
'allocation_method': 'across',
'target_selection': 'all',
'target_type': 'line_item', ...

and

"price_rule" => array (
"title" => $code,
"target_type" => "line_item",
"target_selection" => "all",
"allocation_method" => "across",
"value_type" => "percentage",
"value" => -10.0, ...

What am I missing please?

DonnaC
Shopify Partner
6 0 1

I have an answer, for our private app at least,

In https://xxxxx.myshopify.com/admin/apps/private

select the private app name, and then scroll to the bottom, check if the Webhook API version is below 2020-07, and change it to 2020-07 if it's lower.

It was moaning about the unused webhook, not the API for us.

Jason_Tigas
Shopify Staff (Retired)
28 0 18

Hi, just wanted to say that this is a possibly breaking call, where there's no way for Shopify to know if your app is using the 'one' value. 

So we won't be delisting any apps that continue to get this warning. It's just that our API health report currently has no way to denoting "possibly breaking" vs "actually breaking"

Apologies for the scare of delisting as I know some have tried tirelessly to find the offending calls. 

To learn more visit the Shopify Help Center or the Community Blog.

choonkeat
Shopify Partner
14 0 10

Thanks for confirming that delisting won’t happen for this. Huge relief! 

choonkeat
Shopify Partner
14 0 10

I'm not sure why they don't just say it. I certainly didn't know this setting existed in my partners.shopify.com login

1. Login to you Shopify Partners account https://partners.shopify.com/
2. On the left select All Apps, and then click <Your App Name>
3. Under the app title click App Setup
4. Scroll down to Event Subscriptions and change the drop down to 2020-07 or later.

Tada...... 🎊

Bogdan_Marin
Shopify Partner
16 0 3

+1

Founder of Growth-Connections.com
Rares_Saftoiu
Shopify Partner
15 0 3

Why would they not indicate this dropdown exists anywhere on the api health message? So ridiculous.

Big_Van_Studio1
Shopify Partner
18 0 1

Hello Jason:

Yesterday, with no previous message, we saw this alert on our partner dashboard: https://take.ms/NsIzY. It says that the fixing is overdue (when we have not received any alert previously).

We upgraded all our API calls to version 2020-07 or higher several months ago.

We are working hard to detect which part of the app is making that offending call but I have to say that we do not find where the problem is. Apart from this, the message is confusing because it says that the problem is on the Endpoint orders/create and the API change affected is the field allocationMethod of the DiscountApplication API, but the orders/create endpoint does not have any allocationMethod field and our App is not using the DiscountApplication API.

Besides this, the "View Change" link points to nowhere (https://take.ms/hzKuy). (Points to https://shopify.dev/changelog/removing-discount-allocation-method-one-3)

At this point, we do not know how to deal with this or where we can get further information.
Can you help us with this?

Thanks in advance!!

Ramon

stephers
Shopify Staff (Retired)
9 0 4

Hi everyone - some context for why this change has suddenly popped up on your API Health Reports: we recently noticed that this possibly breaking change in 2020-07 ("Removing discount allocation method: one") had been under-reporting the number of possibly impacted apps and partners. At this point, 2020-07 had already been in effect as of April 1st. Last night, we added additional logging to start to record the additional apps and partners that may have been affected, which caused this change to suddenly pop up on your API Health Reports. 

Given the lack of notice that has been given around this change, we have decided to extend the amount of time that our 2020-04 API version is available for until July 1st to give people time to check their apps and accommodate this change. 

What this means for you:

  • You will want to check your app before July 1st to see if your app is in fact affected by this change. 
  • If your app is affected, you will want to make that change before July 1st. 
  • If your app is not affected, rest assured that we will not be delisting or blocking installs for this breaking change. You may want to upgrade to 2020-07 or later to clear the message though. 

We apologize for all the confusion this has caused! 

To learn more visit the Shopify Help Center or the Community Blog.

Jason_Tigas
Shopify Staff (Retired)
28 0 18

Hi Big Van Studio1,

The reason you are seeing this now is explained in stephers response. As for why you are getting the warning for orders/create is because it returned an order with a discount that had method allocation set as 'one'. As for the link, thanks for pointing that out and it should be fixed now.

To learn more visit the Shopify Help Center or the Community Blog.

stephers
Shopify Staff (Retired)
9 0 4

We've investigated a few of these reports about folks that 1) upgraded to newer API versions and 2) reported still seeing the notice and wanted to share our findings: 

  • @Big_Van_Studio1 - your Qstomizer Custom products app has had webhook calls from the past few days that reference the 2020-04 webhook version, which is why you're still seeing the alert
  • @Akki - your Charge Me Later app no longer has an alert about this change on its API Health Report
  • @facturama - your Facturama app still sees this alert in your API Health Report because it references data from the past 30 days, which means there are typically a few weeks between when you upgrade our app and when this alert falls off your API Health Report. Your last call was still within the current 30 day window, which is why it still shows up. 

To learn more visit the Shopify Help Center or the Community Blog.

ConnectorTeam
Shopify Partner
2 0 0

Me next!

When I checked on the 22nd my last detected date was the 19th, so I was in the clear!

Now it shows a detection on the 14th :-(.

JAS_Technology
Shopify Partner
88 0 66

I also am curious to confirm these types of alerts when it comes to webhooks. Example here: https://share.getcloudapp.com/wbuw9mdg

This webhook was initially created using an older API version and when the deadline approaches this alert will simply clear? There is no possible action to take right? 

Happy to hear about your crazy ideas.
stephers
Shopify Staff (Retired)
9 0 4

Hi @JAS_Technology - if you've already checked and have confirmed that you don't use the allocation method field in your Orders webhooks, you can either:

  • ignore the notice (although note that the notice will still continue to show until we stop notifying people about breaking changes from 2020-07, potentially in October) 
  • update the webhook version associated with the webhook to 2020-07 or later (the notice will disappear 30 days after the last call made with the current webhook version). 

To learn more visit the Shopify Help Center or the Community Blog.

Attentive_Dev
Shopify Partner
2 0 2

I'd like to confirm that this is the case with customers on our private app as well. All our customers got the original email back in January, but when we checked via the API deprecation endpoint, nothing was returned. We were told that we were fine and that the emails were sent because there was no way to be for certain that we were using the deprecated "one" value on the Shopify side.

 

Our customers got hit with the new email, but now when we check the endpoint we do have a deprecated endpoint response. Is this related to the new logging? When I checked our repo, I saw no signs of using allocationMethod: One. Are we in the clear again?

 

Thanks!

stephers
Shopify Staff (Retired)
9 0 4

@Attentive_Dev Yes - could very well be related to the expanded logging we added a few weeks back, which expanded the number of apps and developers we were notifying by quite a bit. If you've already checked your implementation and confirmed that it doesn't use this allocation method field, you should be able to safely ignore the message. 

To learn more visit the Shopify Help Center or the Community Blog.

konradko
Visitor
1 0 0

@Jason_Tigas 

@stephers 

 

We checked our implementation and target_selection is not used anywhere.

API version is 2020-10, both client-side and in Webhook API version settings, but we're still seeing the warning for "Order - Admin - REST" webhook as recently as 2021-05-18.

Is it possible to find the exact offending call from our application like it was mentioned previously or can we safely ignore the message?

Jason_Tigas
Shopify Staff (Retired)
28 0 18

@konradko I'll dm you the details of one of the calls.

To learn more visit the Shopify Help Center or the Community Blog.

PTQ
Visitor
1 0 0

Hi @stephers,

 

We've updated the webhooks in the application configuration to 2020-07

eventVersion.png

The app is not affected by this change, we don't use The allocationMethod field on DiscountApplication. We don't even use the DiscountApplication.

 

But we are still receiving the following message:

message.png

 

Is it possible to find the exact detected call from our application??

 

Thank you in advance.

___END___
Excursionist
28 1 12

Maybe this is your problem: https://community.shopify.com/c/Shopify-APIs-SDKs/Removing-discount-allocation-method-quot-one-quot/...

I'd retrieve the Webhook via the API and check the version property on it. 

Jason_Tigas
Shopify Staff (Retired)
28 0 18

Hi PTQ, can you DM me your app id?

To learn more visit the Shopify Help Center or the Community Blog.

glenndayton
Shopify Partner
6 0 0

@Jason_Tigas Having this exact same issue as well. My app id is: 2954681 Thanks!

Jason_Tigas
Shopify Staff (Retired)
28 0 18

Hi,

Have you checked all your calls, especially the ones where you don't specify a version? For calls which don't specify a version it automatically defaults to the oldest available one, which is 2020-04 right now. However if you wait until July 1 when the next version comes out, the oldest version will be 2020-07 (or newer)

To learn more visit the Shopify Help Center or the Community Blog.

redochkaya
Shopify Partner
14 0 1

Hi

I am getting this same warning although we are not using this discount feature.

app id: 522563 can you check please?

isaacsparling
Visitor
1 0 1

@Jason_Tigas 

We've previously addressed this and it popped back up the other day. I've triple checked that the event version setting is correctly specified in our app dashboard to the latest stable (2021-04) event version. It has been set that way for at least a month.

Do I need to explicitly upgrade the saved event version of every webhook our app has created on install in stores to remove this message?

Appreciate the help,

 

Isaac

mierenga
Visitor
1 0 0

@Jason_Tigas 

Thank you for the extra information about this deprecation and the breakdown of specific cases.

Your information about how discounts are applied under each scenario was very helpful.

I've noticed that when retrieving line items with `ACROSS ALL`, the discount value is not reflected in the `totalDiscountSet` or `discountedUnitPriceSet` for the line item.

However, for items with `EACH ENTITLED` or `ACROSS EXPLICIT`, the discount value is reflected in the `totalDiscountSet` and `discountedUnitPriceSet` for the line item.

I am wondering what to expect for the following cases:

  • `ACROSS ENTITLED`
  • `EACH ALL`
  • `EACH EXPLICIT`

Should the discount allocation value be reflected in the `totalDiscountSet` and `discountedUnitPriceSet`?

Also wondering if all 6 combinations of AllocationMethod and TargetSelection are valid discount scenarios. Please let me know if there is relevant documentation for these details that I was unable to find.

Jason_Tigas
Shopify Staff (Retired)
28 0 18

Hi @mierenga ,

Yes this is a confusing part of the code, that ideally requires further investigation on our end to clean it up.

Only the line-level “logic” discount will be shown in the line item’s discount_allocations.
If it is a cart-level “logic” discount, then it won’t be in the line item’s discount_allocation.

To learn more visit the Shopify Help Center or the Community Blog.

kalitas
Tourist
6 0 1

Hi I read all 4 pages and did not find what im looking for 🙂

1. I use order/paid webhook which is affected by your fix.

2.I don't use the discount property which is returned there

3.I upgraded more than a month ago to 2020-07 but still see that today for example i got the old endpoint

4.is this means i need to delete the webhook for my customers which i registered the webhook before my change to 2020-07 and reregister?

5. is section 2 exclude me from action in section 4? (or exclude me from doing any thing?)

6. app name is minta video

Thanks guys

 

Jason_Tigas
Shopify Staff (Retired)
28 0 18

@kalitas Please update your webhooks to the latest version. You're currently on 2020-04

To learn more visit the Shopify Help Center or the Community Blog.

kalitas
Tourist
6 0 1

ok did it today.

I registered my client through tha api and not through this anyway

___END___
Excursionist
28 1 12

@kalitas Please update your webhooks to the latest version. You're currently on 2020-04

Another confusing part about all of this is no matter what version is set in the app setup page you show above, or what API version is set in the Shopify API client, the webhook's api_version property shows another value!