Update from Legacy API

Updates are always important when it comes to software. They provide corrections to fatal errors, small bugs, improvements and even new features.

CoCart is always evolving! And so is WordPress and WooCommerce.

CoCart is only looking forward to the future and that means it will leave a legacy behind.

Don’t stay stale. Everyone loves a fresh baked cookie. ?

What has changed in the API?

The API its self does not have anything different between the two but to allow CoCart to support additional features, making CoCart a product of its own rather than just a supported extension to WooCommerce’s REST API was an important process.

Not only that, the API is now faster.

Here is a comparison of the API routes. Simply change each API route you use from the legacy API to the CoCart API.

Legacy API

  • wc/v2/cart
  • wc/v2/cart/add
  • wc/v2/cart/calculate
  • wc/v2/cart/clear
  • wc/v2/cart/count-items
  • wc/v2/cart/cart-item
  • wc/v2/cart/totals

CoCart API

  • cocart/v1/get-cart
  • cocart/v1/add-item
  • cocart/v1/calculate
  • cocart/v1/clear
  • cocart/v1/count-items
  • cocart/v1/item
  • cocart/v1/totals

The API routes still uses the same properties.

That’s it.

Happy coding! ?