> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cocartapi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Error Codes

> Error codes returned by the CoCart API v1.

| HTTP Code | Error Code                               | Error Message                                                                                                                                                                                                                                                       |
| --------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| 401       | `cocart_cannot_read_cart`                | Cannot read cart!                                                                                                                                                                                                                                                   |
| 404       | `cocart_customer_missing`                | Customer ID is required!                                                                                                                                                                                                                                            |
| 404       | `cocart_cart_key_missing`                | Cart Key is required!                                                                                                                                                                                                                                               |
| 404       | `cocart_cart_in_session_not_valid`       | Cart in session is not valid!                                                                                                                                                                                                                                       |
| 404       | `cocart_clear_cart_failed`               | Clearing the cart failed!                                                                                                                                                                                                                                           |
| 404       | `cocart_product_id_required`             | Product ID number is required!                                                                                                                                                                                                                                      |
| 405       | `cocart_product_id_not_numeric`          | Product ID must be numeric!                                                                                                                                                                                                                                         |
| 405       | `cocart_quantity_not_numeric`            | Quantity must be numeric!                                                                                                                                                                                                                                           |
| 404       | `cocart_product_does_not_exist`          | Warning: This product does not exist!                                                                                                                                                                                                                               |
| 403       | `cocart_product_sold_individually`       | You cannot add another "<Tooltip tip="%s is the product name">%s</Tooltip>" to your cart.                                                                                                                                                                           |
| 403       | `cocart_cannot_be_purchased`             | Sorry, this product cannot be purchased.                                                                                                                                                                                                                            |
| 404       | `cocart_product_out_of_stock`            | You cannot add "%s" to the cart because the product is out of stock. <i class="label label-info">%s is the product name</i>                                                                                                                                         |
| 403       | `cocart_not_enough_in_stock`             | You cannot add a quantity of <Tooltip tip="%1$s">%1$s: quantity requested</Tooltip> for "<Tooltip tip="%2$s: product name>`%2$s`</Tooltip>" to the cart because there is not enough stock. - only <Tooltip tip="%3$s: stock remaining.">`%3$s`</Tooltip> remaining! |
| 403       | `cocart_not_enough_stock_remaining`      | You cannot add that amount to the cart — we have `%1$s` in stock and you already have `%2$s` in your cart.                                                                                                                                                          |
| 403       | `cocart_not_ok_to_add_item`              | This item can not be added to the cart.                                                                                                                                                                                                                             |
| 403       | `cocart_cannot_add_to_cart`              | You cannot add "`%s`" to your cart. <i class="label label-info">%s is the product name</i>                                                                                                                                                                          |
| 403       | `cocart_can_not_remove_item`             | Unable to remove item from cart.                                                                                                                                                                                                                                    |
| 403       | `cocart_can_not_restore_item`            | Unable to restore item to the cart.                                                                                                                                                                                                                                 |
| 403       | `cocart_can_not_update_item`             | Unable to update item quantity in cart.                                                                                                                                                                                                                             |
| 404       | `cocart_cart_item_key_required`          | Cart item key is required!                                                                                                                                                                                                                                          |
| 404       | `cocart_no_items`                        | No items in cart.                                                                                                                                                                                                                                                   |
| 404       | `cocart_item_not_in_cart`                | Item specified does not exist in cart.                                                                                                                                                                                                                              |
| 403       | `cocart_cannot_add_product_type_to_cart` | You cannot add "`%1$s`" to your cart as it is an "`%2$s`" product. <i class="label label-info">%1$s: product name, %2$s: product type</i>                                                                                                                           |
| 400       | `cocart_invalid_variation_data`          | Invalid value posted for `%1$s`. Allowed values: `%2$s` <i class="label label-info">%1$s: Attribute name, %2$s: Allowed values</i>                                                                                                                                  |
| 400       | `cocart_missing_variation_data`          | Missing variation data for variable product. `%s` is a required field. <i class="label label-info">%s: Attribute name.</i>                                                                                                                                          |
| 400       | `cocart_missing_variation_data`          | Missing variation data for variable product. `%s` are required fields. <i class="label label-info">%s: Attribute name.</i>                                                                                                                                          |
| 400       | `cocart_no_variation_found`              | No matching variation found.                                                                                                                                                                                                                                        |
| 403       | `cocart_cart_invalid_parent_product`     | This product cannot be added to the cart.                                                                                                                                                                                                                           |
| 404       | `cocart_product_failed_validation`       | Product did not pass validation!                                                                                                                                                                                                                                    |
| 403       | `cocart_product_sold_individually`       | You cannot add another "`%s`" to your cart.                                                                                                                                                                                                                         |
| 403       | `cocart_can_not_increase_quantity`       | You can only have 1 `%s` in your cart. <i class="label label-info">%s is the product name</i>                                                                                                                                                                       |
