CoCart version 2 is currently in development and I wanted to give you all a heads up on one core change coming to CoCart and that is the endpoint.
Currently, the API migrates under WooCommerce’s API. At the time of CoCart’s early development, the WooCommerce API was version 2. Now WooCommerce’s API is on version 3.
I have not updated the version CoCart is nested under for two reasons.
- WooCommerce API version 2 still works fine with CoCart.
- I did not want users of CoCart to change the API endpoint again in their site or app projects once version 2 of CoCart is available.
For CoCart to evolve the API endpoints need to move out of WooCommerce’s API and get its own place. This will also help to keep compatibility with WooCommerce and increase the strength of the code for the future.
When version 2 is released, there is no need to worry about making any changes to your site or app using CoCart straight away as the current API will still be supported as a legacy API but when you have the chance to switch over to the new API, I highly recommend that you do so, especially if you are going to be using CoCart Pro once it is released.
The current API endpoint is like so: yourdomainname.xyz/wp-json/wc/v2/cart/
When version 2 is made available, the new endpoint will be like so: yourdomainname.xyz/wp-json/cocart/v1/cart/
This is just the first step for CoCart to evolve. More details will be shared in the next news post.
If you have a comment or suggestion for moving the API endpoint, please leave your comments below.
Thank you for reading.