Cart REST API for WooCommerce – CoCart Lite


Build headless stores, without building an API

CoCart handles the shopping cart in any modern framework of your choosing. No local storing required. Powerful and developer friendly ready to build your headless store.

Built 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?

The question is why not! WooCommerce’s REST API is only created for controlling the backend of your store. Not the API your needing for your customers who only see the frontend.

If you are wanting to build a headless WooCommerce store then CoCart is your 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.

  • NEW: Support for guest customers.
  • NEW: Logout customer.
  • Add simple and variable products to the cart.
  • Update items in the cart.
  • Remove items from the cart.
  • Restore items to the cart.
  • Calculate the totals.
  • Retrieve the cart totals.
  • View the cart contents.
  • Retrieve the item count.
  • Empty the cart.
  • Supports basic authentication without the need to cookie authenticate.
  • Supports authentication via WooCommerce’s method.

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

  • CoCart Product Support Boilerplate provides a basic boilerplate for supporting a different product type to add to the cart with validation including adding your own parameters.
  • 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
  • Coming Soon Retrieve Checkout Fields (In Development)
  • Coming Soon Set Cart (In Development)
  • Coming Soon Create Order (In Development)
  • Coming Soon Return Customers Orders (In Development)
  • Coming Soon Return Customers Subscriptions (In Development)
  • Coming Soon Return Customers Downloads (In Development)
  • Coming Soon Get and Update Customers Profile (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.

  • Get Cart Enhanced enhances the cart response returned with the cart totals, coupons applied, additional product details and more. – FREE
  • Products provides a public version of WooCommerce REST API for accessing products, categories, tags, attributes and even reviews without the need to authenticate.
  • Advanced Custom Fields extends CoCart Products add-on by returning all your advanced custom fields for products. – REQUIRES COCART PRODUCTS
  • Yoast SEO extends CoCart Products add-on by returning Yoast SEO data for products, product categories and product tags.
  • 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.

Contributors & Developers

„CoCart Lite“ has not yet been translated. You can translate „CoCart Lite“ into your language.


Browse the code, check out the SVN repository, or subscribe to the development log by RSS.


  • 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.


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!

Why should I use CoCart?

The question is why not! WooCommerce’s REST API is only created for controlling the backend of your store. Not the API your needing for your customers who only see the frontend.

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

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. Checkout the tweaks plugin to view or maybe use the examples provided. View the documentation for more.

Does it work with any of the official WooCommerce libraries?

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

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 or join the CoCart Community on Slack where you will find like minded developers who help each other out.


17. Dezember 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
Lies alle 12 Rezensionen

Mitwirkende & Entwickler

„Cart REST API for WooCommerce – CoCart Lite“ ist Open-Source-Software. Folgende Menschen haben an diesem Plugin mitgewirkt:



v2.1.2 – 4th June, 2020

  • NEW: Added support for guest customers.
  • NEW: Carts in session are stored in a new database table.
  • NEW: Carts are in sync across the web store and your headless store.
  • NEW: Added plugin details to WooCommerce System Status.
  • NEW: Added uninstall.php file to delete table and options.
  • NEW: Able to transfer a cart from your headless store to the web.
  • NEW: Added handlers to improve product validation and extended support for other product types.
  • NEW: Can now add items to cart using a products SKU ID.
  • NEW: When an item is updated, removed or restored… the cart totals are re-calculated.
  • NEW: Added option to logout customer.
  • NEW: Variable products are now validated and can find variation ID from attributes if not already set.
  • NEW: Prevent password protected products from being added to the cart.
  • NEW: Prevent CoCart from being cached with WP REST API Cache plugin.
  • Changed: Parameter used to set cart key. Previously id now cart_key. The id used as fallback if still used.
  • Removed: Parameter to re-calculate totals once item was updated.
  • Tweaked: Clear carts debug tool now clears saved carts as well.
  • Tweaked: Products that are no longer purchasable and are already in the cart are removed from the cart.
  • Tweaked: Stop redirect to getting started page if plugin was activated and was already installed before.
  • Tweaked: Prevent redirect to getting started page if multiple plugins activated at once.
  • Dev: Clear all carts stored in session via the Tools section of WooCommerce System Status.
  • Dev: Synchronize carts over to CoCart’s session table in the database via the Tools section of WooCommerce System Status.
  • Dev: Cart expiration can be filtered if the default 30 days is not to your liking.
  • Dev: Generated customer ID can be filtered before storing cart in the database and creates a cookie on the customer’s device.
  • Dev: Added filter cocart_add_to_cart_validation to allow plugin developers to pass their own validation before item is added to the cart.
  • Dev: Added filter cocart_update_cart_validation to allow plugin developers to pass their own validation before item is updated in the cart.
  • Dev: Added filters to override the product name cocart_product_name and product title cocart_product_title when getting the cart contents.
  • Dev: Added filter cocart_item_thumbnail_src to override the source URL of the product thumbnail when getting the cart contents.
  • Dev: Added filter cocart_add_to_cart_quantity to override the quantity when adding an item.
  • Dev: Added filter cocart_add_cart_item_data so other plugins can pass cart item data when adding an item.
  • Dev: Added filters so the returned response messages can be changed.
  • Dev: Added conditional filter for returning a cart item.
  • Dev: Added hook cocart_user_switched to allow something to happen if a user has switched.
  • Dev: Added hook cocart_load_cart to manipulate the merged cart before it set in session.
  • Dev: Added hook cocart_load_cart_override to manipulate the overriding cart before it set in session.
  • Dev: Added hook cocart_item_added_updated_in_cart for when an item was added again but updated in cart.
  • Dev: Added a new class that handles logging errors.
  • Dev: Added filters to admin notices to extend the length of time they hide.
  • Dev: Added filter to override cookie check for authenticated users.
  • Tested: Compatible with WooCommerce v4.2.x

This update replaces WooCommerce core session handler with CoCart’s. 100% backwards compatible.

View the full changelog here.