cart_key
and via the returned headers called CoCart-API-Cart-Key
once the first API request has been made.
Once you have the cart key, you can then use it to set the cart_key
as a global parameter with any of the Cart API routes to load that cart.
Without the cart key set for other Cart API routes, any requests made will not be applied to the appropriate cart session. This is partially important when adding, updating or removing items to and from the cart as such. The same for coupons, fees and other cart related requests made.
cart_key
parameter is a global parameter so it must be queried rather than being added as part of the body data you send with the API request you make. Otherwise it will not update the appropriate cart. Should you fail to do so correctly will lead to adding items stored in their own individual cart session which you will not be able to recover from previous requests.