This post is a friendly reminder that the Legacy REST API will be removed in WooCommerce 9.0, which is scheduled for release on June 11, 2024.
For most of our users this should not present any sort of problem but, for any users who do still depend on the Legacy REST API, we have prepared a separate plugin that you can install to provide some additional time in which to transition.
Confused, or needing extra help figuring this out? Please read on 🙂
What is the Legacy REST API?
WooCommerce provides a REST API allowing other systems to ‘talk to’ and exercise control over your online store. For example, you might decide to integrate a shipping service with your store, and the REST API would provide a way for them to update order statuses, as and when products are shipped to customers.
There are actually several supported versions of the WooCommerce REST API, and we are only removing some very old versions that have now been deprecated for many years.
Am I using the Legacy REST API?
This is the key question because, if you are not using the Legacy REST API, you can simply move on without worrying about this change.
A great initial step is to visit WooCommerce ▸ Settings ▸ Advanced ▸ Legacy REST API and check if the legacy system is enabled: if it is not enabled, you have nothing else to worry about, and can stop reading. In other cases it may be enabled, but you may be unsure if it is actually being used and if you can simply disable it.
To help make it as easy as possible to answer this question, recent versions of WooCommerce (8.5 onwards) actively detect if the Legacy REST API is being used, and will display an admin notice looking something like this:
You can then follow the link to the log files, and gather additional information. For example:
In the above example, we see the following in the log entry:
Route: /customers/count
→ information about customers is being accessed.shipshapeshipping/1.2.3
→ a clue as to the service making the API requests (here, a fictional shipping provider called Shipshape Shipping).
Based on this information, you can make contact with the relevant service provider and ask them about their plans to transition to a currently supported version of the REST API.
Other ways to determine if the Legacy REST API is being used
We also recommend that you visit the WooCommerce ▸ Settings ▸ Advanced ▸ Webhooks screen. If you see one or more active legacy webhooks, as in the following screenshot, then it is likely you still need the Legacy REST API:
Finally, you may find it helpful to visit the WooCommerce ▸ Settings ▸ Advanced ▸ REST API screen. This contains a list of generated API keys and, if nothing is listed here, that suggests that you don’t need to worry about external services using the legacy API. In other words, it is almost certainly safe to disable the Legacy REST API if:
- You don’t have any legacy webhooks
- And you don’t have any API keys
On the other hand, if you do see API keys listed there, you may be able to glean hints as to what service is using them based on the descriptions assigned to each key … but unfortunately it is not possible to tell if they are exclusively used for legacy API purposes or not. However, so long as you update to WooCommerce 8.5 or greater, you should be able to take advantage of the detection system described above.
Installing the Legacy REST API plugin
For those of you who need more time to transition, we recommend that you install and activate the Legacy REST API plugin, available in the official WordPress plugin directory:
wordpress.org/plugins/woocommerce-legacy-rest-api
In fact, as of WooCommerce 8.8, if the system believes that you need this plugin you may find it has already been installed for you:
You can learn more about automatic installation of this plugin in this announcement, which also provides guidance for those wishing to block installation.
I have the legacy plugin, what next?
We do not plan on supporting the Legacy REST API plugin indefinitely, and strongly recommend transitioning to currently supported versions of the REST API (the current stable version is version 3).
In most cases, we expect that this is actually in the hands of various third party services you have decided to integrate with, so you should do your best to reach out to them and ask about their plans for transitioning.
Additionally, the Legacy REST API is not currently compatible with High-Performance Order Storage (HPOS). If you need to use both, please be sure to visit WooCommerce ▸ Settings ▸ Advanced ▸ Features (you can also use the information in this screen to find out if HPOS is enabled) and turn on Compatibility Mode.
Last but not least, you may simply wish to install the legacy plugin for extra safety. There is absolutely nothing wrong with this, but please watch out for notifications and log entries alerting you to actual Legacy REST API usage, as described above: if you find that some weeks or months roll by without any usage being detected, that is a reasonable indication that it is safe to remove the plugin.
As ever, we’re here to help. Let us know if we can clarify anything or provide additional guidance.
Leave a Reply