2024-07 or later Deprecated APi

We updated to 2024-07 over a month ago however we are still getting this warning.
Our last detected was March 3rd. :sweat_smile:
I’m not sure what else we are supposed to do.

We may need your help almighty @Liam-Shopify :slight_smile:

Hey @Ty_Chapman,

There’s a few things I’d do to try and track down what’s causing this:

Verify most of your webhooks are on 2024-07

  1. Go to the webhook page in the partner admin (Insights → Webhooks)
  2. Click on the products/update under ‘Webhook topics’ to see a list of recent webhook sends
  3. Click on several of the individual logs and a sidebar opens on the right, verify that the API version is 2024-07

Add logging to check for the occasional webhook on an old version

Since you’re only seeing this message occasionally it probably means that the majority of your webhooks are fine, there’s just one or two that are stragglers for some reason.

What I’d do next is to add logging in the code that processes webhooks that will raise a warning if the API webhook version is too old. Every webhook has the following headers we can use:

  • X-Shopify-API-Version
  • X-Shopify-Shop-Domain

The specific code and logging depends on your environment but at a high level it would look something like this:

api_version = request.headers['x-shopify-api-version']
if api_version < '2024-07':
    logger.warning("Old API version for " + request.headers['x-shopify-shop-domain'])

Then deploy that and check for the warning in your logs, especially after the partner admin says you’ve received another out-of-date webhook.

If this does trigger on a store I would try recreating the webhooks on that store (assuming you’re not using the managed webhook config). In the past we’ve seen rare cases where a store could have two versions of the same webhook registered. Deleting all your webhooks and registering them might fix that.

Asking Shopify support

Shopify partner support might be able to give you the store(s) that are triggering those out-of-date webhooks. I think Shopify only keeps logs for about 7 days though so it might be too late for something that ran on March 3 (I’d give a buffer of a day or two for it to get escalated to the right person).

Checking other environments

It’s also possible that your primary app/environment is all setup correctly but there’s some other script running, maybe on a developer machine, that’s making out-dated API calls. I don’t know if creating the webhooks with an older API version would trigger the error but also something to look at.

I hope something in this helps, I’ve spent a fair share of time tracking down deprecated calls after I thought we’d updated everything. If there’s anything I can expand on just let me know.

Best,
Daniel

1 Like