Favourite Products provides users with a convenient and efficient method to bookmark and save their preferred items for future purchases. This feature enables users to create a personalized collection of products they are interested in, allowing for easy access.
All favourite product API methods require “Authentication” for security. The token is included in the HTTP request header under the Authorization field, as demonstrated in the provided request examples.
POST Add a Favourite Product
This method adds a product to the user's list of favourite products. Before adding a product, it checks whether it is already in the list by looking up the user and product ID or the product base code. If the FAVOURITE_SKU_IS_ACTIVE dynamic setting is true, it checks using the product ID; otherwise, it uses the product base code. If the product is already in the list, it throws a 406 error. If not, it adds the product to the list. If multiple entries are found, it returns the first one found.
There is no content to send in the response payload body.
GET List Favourite Products
This method is used to fetch the list of a user's favourite products. It can be filtered by product_id, base_code__in, and product_name. Both product_id and base_code__in can accept either a list or a single parameter. If the FAVOURITE_SKU_IS_ACTIVE dynamic setting is true, favourite products are ordered by product_id; otherwise, they are ordered by product__base_code. Additionally, products are fetched along with their basket offers.