Cart REST API for WooCommerce – CoCart Lite


CoCart is a flexible, open-source solution to enabling the shopping cart via the REST API for WooCommerce.

With CoCart, running your WooCommerce store completely via the REST API is now possible. Control and manage the shopping cart with ease. Powerful options, clear responses and developer ready for any filtering required to your needs.

Why should I use CoCart?

WooCommerce REST API is created with developers in mind, so it can integrate with virtually any service and while it does allow developers to easily create and modify. It only allows them to scale a store so much to meet a client’s specifications without further custom development that will enable the stores customers access to the products in order to add them to the shopping cart.

If you are wanting to build a headless WooCommerce store then CoCart is your missing solution.

With the documentation provided, you’ll learn how to enable the cart for your store in no time.


CoCart provides the basic features to get you started.

  • Add simple and variable products to the cart (including simple and variable subscription products).
  • Update items in the cart.
  • Remove items from the cart.
  • Restore items to the cart.
  • Calculate the totals.
  • Get the cart totals.
  • View the cart contents.
  • Get the item count.
  • Empty the cart.
  • Supports authentication via WooCommerce’s method.
  • NEW Supports basic authentication without the need to cookie authenticate.

Included with these features are filters and action hooks for developers.

  • CoCart Tools provides tools to help with development testing with CoCart.
  • CoCart Tweaks provides a starting point for developers to tweak CoCart to their needs.

CoCart Pro

This plugin is just the tip of the iceberg. CoCart Pro completes it with the following features:

  • Add and Remove Coupons to Cart
  • Retrieve Applied Coupons
  • Retrieve Coupon Discount Total
  • Retrieve Cart Total Weight
  • Retrieve Cross Sells
  • Retrieve and Set Payment Method
  • Retrieve and Set Shipping Methods
  • Retrieve and Set Fees
  • Calculate Shipping Fees
  • Calculate Totals and Fees
  • NEW Retrieve Checkout Fields (In Development)
  • NEW Create Order (In Development)

Buy CoCart Pro Now

Extensions supported

CoCart Pro also supports:

Add-ons to further enhance your cart.

We also have add-ons that extend CoCart to enhance your development and your customers shopping experience.

  • CoCart – Get Cart Enhanced enhances the cart response returned with the cart totals, coupons applied, additional product details and more. – FREE
  • CoCart Products provides a public version of WooCommerce REST API for accessing products, categories, tags, attributes and
    even reviews without the need to authenticate. – REQUIRES COCART PRO
  • CoCart Yoast SEO extends CoCart Products add-on by returning Yoast SEO data for products, product categories and product tags. – REQUIRES COCART PRO
  • and more add-ons in development.

Join our growing community

A Slack community for developers, WordPress agencies and shop owners building the fastest and best headless WooCommerce stores with CoCart.

Join our community

Built with developers in mind

Extensible, adaptable, and open source — CoCart is created with developers in mind. If you’re interested to jump in the project, there are opportunities for developers at all levels to get involved. Contribute to CoCart on the GitHub repository and join the party.

Bug reports

Bug reports for CoCart are welcomed in the CoCart repository on GitHub. Please note that GitHub is not a support forum, and that issues that aren’t properly qualified as bugs will be closed.

More information


This plugin is created by Sébastien Dumont.


  • Empty Cart
  • Viewing the carts content without product thumbnail.
  • Viewing the carts content with product thumbnail.


Minimum Requirements

Visit the WooCommerce server requirements documentation for a detailed list of server requirements.

Automatic installation

Automatic installation is the easiest option as WordPress handles the file transfers itself and you don’t need to leave your web browser. To do an automatic install of CoCart, log in to your WordPress dashboard, navigate to the Plugins menu and click Add New.

In the search field type «CoCart» and click Search Plugins. Once you’ve found the plugin you can view details about it such as the point release, rating and description. Most importantly of course, you can install it by simply clicking «Install Now».

Manual installation

The manual installation method involves downloading the plugin and uploading it to your webserver via your favourite FTP application. The WordPress codex contains instructions on how to do this here.


Automatic updates should work like a charm; as always though, ensure you backup your site just in case.

Vanlege spm.

Is CoCart free?

Yes! CoCart’s core features are absolutely free. CoCart Pro completes the full cart experience!

How do I start using CoCart?

You will first need WooCommerce v3.6 or higher installed with the REST API enabled. Then install CoCart and follow the documentation. That’s it!

Who should use CoCart?

CoCart is perfect for store owners and developers. If you want to create an e-commerce app for mobile or a custom frontend shopping experience completely using the REST API, then you need to use CoCart.

Do I need to have coding skills to use CoCart?

As this plugin is built for developers you will need to have some coding knowledge to use it. Checkout the documentation to get some understanding.

Where can I find documentation for CoCart?

The documentation for CoCart can be found here.

Can I change the layout format/add/change details to the responses?

You certainly can. Filters are available to do just that (so long as you are using version 2.0+). Checkout the tweaks plugin to view or maybe use the examples provided.

Does it work with any of the official WooCommerce libraries?

Only if you request your customers to be logged in first. This is because all the official libraries require authentication which the cart does not require.

Can I view any customers cart?

Yes but only those with administrator capabilities can and if persistent cart was left enabled. – See documentation for more information.

Are you a Mobile app developer? In preparation for CoCart v2.1.0, support for storing cart data will be introduced to make it easier to access specific carts created and your feedback is needed. Read this article for more details.

Where can I report bugs or contribute to the project?

Report bugs on the CoCart GitHub repository.

Is CoCart translatable?

Yes! CoCart is deployed with full translation and localization support via the ‘cart-rest-api-for-woocommerce’ text-domain.

Where can I ask for help?

If you get stuck, you can ask for help in the CoCart support forum.


17. desember 2019
Thanks for doing such a great work with this! Works exactly as expected and CoCart seems to have a nice community around it. The founder seems really devoted and that's one of the key things for a plugin like this to live on and get the right updates in the future. We just got ourselfs the lifetime subscription.
22. november 2019
The plugin works very well. It really saved me time using the REST API to update the total number of products in the cart when someone adds a new item to the cart
Les alle 12 omtalar

Bidragsytarar og utviklarar

“Cart REST API for WooCommerce – CoCart Lite” is open source software. The following people have contributed to this plugin.



v2.0.13 – 13th April, 2020

  • Filtered: woocommerce_stock_amount to validate as a float value.
  • Changed: Quantity value type from integer to float to allow quantity to be used for weighing fruit for example when adding or updating a product.
  • Dev: Added filter for sold individual products quantity to be overridden. – cocart_add_to_cart_sold_individually_quantity

This is a community release by @metemaddar

v2.0.12 – 27th March, 2020

  • Tested: Compatible with WordPress 5.4
  • Added: Upgrade notice message on plugins upgrade screen.

v2.0.11 – 25th March, 2020

  • Removed: cocart_docs_url filter for changing documentation link.
  • Tested: Compatible with WooCommerce v4.0.x
  • Updated: Getting Started page and removed cocart_getting_started_doc_url filter for the documentation button.
  • Updated: Plugin action link for upgrading to CoCart Pro.
  • Updated: Upgrade notices.

Please temporarily deactivate CoCart and CoCart Pro (if you have it) before updating WooCommerce to version 4.0+ as there is an activation order issue I am still working on fixing. Once you have upgraded WooCommerce simply reactivate CoCart.

v2.0.10 – 22nd March, 2020

  • Tweaked: Refresh totals parameter is now set to true by default when item is updated.

v2.0.9 – 19th March, 2020

  • Corrected: Passed parameter to get specific customers cart.
  • Tweaked: Validation of returning persistent cart.

v2.0.8 – 6th March, 2020

  • Dev: Added filter cocart_return_empty_cart to empty cart response so developers can use it as they see fit.

v2.0.7 – 5th March, 2020

  • Disabled: Cookie authentication REST check, only if site is secure when authenticating the basic method.
  • Removed: Filter for session class handler as we need it to be untouched.
  • Tested: Compatible with WooCommerce v3.9.x
  • Tweaked: Use get_current_user_id() instead of is_user_logged_in() to check if user is logged in.

The cookie check is only disabled when making a request with CoCart.

v2.0.6 – 1st October, 2019

  • Added: Link to translate CoCart on the plugin row.
  • Tweaked: Upgrade admin notice for next release.
  • Tweaked: URL to latest beta news under the plugin row.

v2.0.5 – 14th September, 2019

  • Added: Support for WooCommerce’s authentication method.

v2.0.4 – 26th August, 2019

  • Added: More FAQ’s to readme.txt file for the WordPress plugin directory.
  • Changed: Title of the plugin in readme.txt file to improve SEO Results.
  • Changed: Minimum WooCommerce version required and supported is v3.6.
  • Tweaked: Upgrade link now shows always once plugin is installed, not after 1 week.
  • Tweaked: Upgrade link colour changed from green to red to stand out more.

v2.0.3 – 19th August, 2019

  • Added: A notice under the plugin row providing information on future versions coming that require your feedback.
  • Tested: Compatible with WooCommerce v3.7
  • Tweaked: Admin body class for CoCart page.
  • Updated: Documentation URL has changed to

v2.0.2 – 19th July, 2019

  • Tweaked: Updated link to getting started page if CoCart was installed via WP-CLI.

v2.0.1 – 18th July, 2019

  • Tweaked: get_cart_contents_count() is now called static.
  • Tweaked: Added check for cart totals to make sure they are set before falling back to cart totals in session.
  • Dev: Added filter cocart_update_item for the response when updating an item.
  • Dev: Tweaked CoCart page in the WordPress dashboard to support sections.

v2.0.0 – 3rd July, 2019

  • NEW: REST API namespace. CoCart is now an individual API and is no longer nested with WooCommerce’s core REST API.
  • NEW: Check to see if the cart is set before falling back to the cart in session if one exists.
  • NEW: Get a specific customers cart via their customer ID number. – See documentation for details.
  • NEW: Product title also returns besides just the product name when getting the cart.
  • NEW: Product price also returns when getting the cart.
  • Changed: Filter and Action Hook names in new API. – See documentation for details.
  • Improved: Complexity of functions for better performance and usage.
  • Tweaked: Added checking for items already in the cart.
  • Tweaked: Check if cart is empty before removing an item.
  • Tweaked: Responses for adding, updating, removing and restoring items to return whole cart if requested.
  • Tweaked: Responses for updating items to return the quantity of item along with message.
  • Tweaked: Totals can now return once calculated if requested.
  • Tweaked: Totals now return from session and can be returned pre-formatted if requested. – See documentation for details.
  • Tweaked: New option to refresh cart totals once item has been added or updated.
  • Dev: Added action hooks for getting cart, cart is cleared, item added, item removed and item restored.
  • Dev: Added filter to allow additional checks before the item is added to the cart.
  • Dev: Added filter to apply additional data to return when cart is returned.
  • Dev: Added filter to change the size of the thumbnail returned.
  • Dev: Added new option to return cart raw if requested.

View the full changelog here.