Understanding YITH WooCommerce Wishlist REST API Support and Common Issues
Content
Many developers integrating the popular YITH WooCommerce Wishlist plugin with mobile apps or custom frontends run into a common roadblock: the lack of official REST API endpoints. This article explains the current state of REST API support and clarifies common error messages you might encounter.
The Core Issue: No Official REST API (Yet)
Based on numerous community inquiries, the most important thing to understand is that the free version of the YITH WooCommerce Wishlist plugin does not natively expose a set of REST API endpoints. This means you cannot use standard WooCommerce REST API calls (/wp-json/wc/v3/...) to directly get, add, or delete items from a user's wishlist.
This limitation is confirmed by multiple responses from the YITH team across different support threads. They have stated that while they plan to introduce this feature in a future major release (potentially version 3.1), it is not currently available. This is the fundamental reason behind many of the errors developers experience.
Common Errors and Why They Happen
1. The "rest_forbidden" Error (403)
Error Message: {"code": "rest_forbidden", "message": "Sorry, you are not allowed to do that.", "data": {"status": 403 }}
Cause: This error strongly suggests you are attempting to call a WordPress or WooCommerce REST API endpoint that does not exist for the wishlist functionality. The server is rejecting the request because the endpoint you are using is not configured to handle wishlist operations, leading to a permissions error. You are likely trying to use a WooCommerce endpoint that isn't designed for this plugin.
2. The "Product not found" or "wishlist_products_not_found" Error (400)
Error Message: {"code": "ti_woocommerce_wishlist_api_wishlist_products_not_found", "message": "Add product to wishlist failed.", "data": {"status": 400 }}
Cause: Interestingly, this error might indicate that you are accidentally calling a REST endpoint belonging to a different wishlist plugin (e.g., "Ti WooCommerce Wishlist"), not the YITH plugin. The error code prefix ti_woocommerce_wishlist_api_ is a clear sign of this. Your request is being routed to the wrong plugin's endpoint, which then fails because it cannot find a valid wishlist context for your request.
Current Workarounds and Future Developments
Since native API support is not available, developers have typically had to create custom solutions. This often involves writing custom PHP code to extend the WordPress REST API and create your own secure endpoints that interact with the YITH wishlist functions.
The YITH team has indicated that official development for this feature is planned. They have invited developers to contribute to the project or join discussions on its official GitHub page, which is more focused on development. Monitoring the GitHub repository is the best way to get updates on the progress of REST API support.
Conclusion
The frequent errors users see are not bugs in the traditional sense but are the result of attempting to use non-existent API endpoints. The rest_forbidden error points to a permissions issue on an invalid endpoint, while the ti_woocommerce_wishlist_api_... error strongly suggests a conflict with another wishlist plugin. Until the YITH team releases official support, custom development or closely following their GitHub for updates are the primary paths forward.
Related Support Threads Support
-
Status on REST API supporthttps://wordpress.org/support/topic/status-on-rest-api-support/
-
[Feature Request] REST API Supporthttps://wordpress.org/support/topic/feature-request-rest-api-support/
-
a way for connect wishlist for flutter app using woocommerce rest apihttps://wordpress.org/support/topic/a-way-for-connect-wishlist-for-flutter-app-using-woocommerce-rest-api/
-
Product wishlist rest apihttps://wordpress.org/support/topic/product-wishlist-rest-api/
-
Rest api for pluginhttps://wordpress.org/support/topic/rest-api-for-plugin/
-
Always get Product not found error when trying to add valid product to wishlisthttps://wordpress.org/support/topic/always-get-product-not-found-error-when-trying-to-add-valid-product-to-wishlist/
-
[NSFW] Wishlist Rest APIhttps://wordpress.org/support/topic/wishlist-rest-api/