This feature is not part of the REST API. Do not treat it as such!
Please note: This version of the feature is for sites running versions of CoCart Core starting at v5. If you use this feature already it will break unless you follow the changes below, so check you are using the correct version before continuing with the documentation.
This feature is designed to load the customers cart over to the web version of your store. It allows both guest and registered customers to load their carts to continue shopping or checkout what they have in the cart added via your headless application without exposing login details. It’s handy if you have not yet worked with payment gateway like Stripe to handle the headless checkout.

Query properties

QueryTypeDescription
cocart-load-cartstringSet the cart key of the cart you wish to load. mandatory
c_hashstringThe cart hash which represents the last data change of the cart. mandatory
To load the cart from session on your web store, you must use the properties above to query your website. You can query any page you prefer your customer to land on as the cart is loaded in the background.
https://your.store/checkout/?cocart-load-cart={cart_key}&c_hash={cart_hash}
If a customer is already logged in via the web version of your store then WooCommerce will merge any items in the cart together with the items the guest customer has in cart.If the same item already exists in cart, the quantity of that item will increase if stock is available.

FAQ