Support » Plugin: CoCart - Headless ecommerce » V1 Cart API out of stock returning 403 error

  • Resolved alihabib2005


    Hello Dears,

    I’m using your plugin (cart API v1) for a while but recently noticed when a user tries to add a quantity that exceeds the stock amount he gets a 403 forbidden HTTP error which is causing the app to trigger the authentication flow and causing crashes.

    we believe the http code should be 200 instead as the error message is already in the response.

    Reference wp-content/plugins/cart-rest-api-for-woocommerce/includes/api/cocart/v1/cart/class-cocart-controller.php line 735 and 822

    Please advise

Viewing 1 replies (of 1 total)
  • Plugin Author Sébastien Dumont



    Not sure what you mean by it triggers your authentication flow but the status code is based on the error message given.

    An error cannot return as 200 as that means it was successful.

    Support for API v1 in the core plugin is no longer supported as stated at the top of the plugin description.

    Might I suggest updating to use API v2 which the status code was changed to 404 for this error as part of making the errors respond less aggressive to some frameworks.

    Let me know if you have any more questions.



Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.