Wishlist Screen

Wishlist APIs are used add remove and view products in Wishlist.

Wishlist API

The Wishlist API allows customers to manage their wishlist on the e-commerce platform, enabling them to add and remove products they are interested in purchasing later. The API offers endpoints for viewing the wishlist, adding products to the wishlist, and removing products from the wishlist.

Wishlist interface

1. Get Wishlist API

The Get Wishlist API retrieves the list of products that the customer has added to their Wishlist.

Endpoint

  • {{baseurl}}/api/v1/wishlists

Method

  • GET

Request Parameters

  • lang_code (optional): The two-letter language code used to retrieve product names and details in a specific language. If provided, the API returns product information in the specified language.

Authorization

The API requires a valid bearer token in the request header for authentication. Users must include their token in the "Authorization" header to access their wishlist.

Response Format

The API responds with a JSON array containing wishlist items. Each item represents a product in the wishlist and includes details such as the product ID, name, country variation ID, and other relevant information.

Example Response:

2. Add to Wishlist API

The Add to Wishlist API allows customers to add products to their wishlist.

Endpoint

  • {{baseurl}}/api/v1/wishlist/store

Method

  • POST

Request Body

The API expects a JSON object containing the following parameters:

  • product_id: The unique identifier of the product to be added to the wishlist.

  • country_variation_id: The specific country variation of the product selected (if applicable).

Example Request Body:

Authorization

The API requires a valid bearer token in the request header for authentication and user authorization. Users must provide a token to access their personalized wishlist.

Response Format

The API responds with a JSON object indicating the status of the wishlist addition request. It provides information about the added product, including the product ID, name, and other details.

Example Response:

3. Remove from Wishlist API

The Remove from Wishlist API allows customers to remove a specific product from their wishlist.

Endpoint

  • {{baseurl}}/api/v1/wishlist/destroy/{wishlist_id}

Method

  • GET

Request Parameter

  • wishlist_id (required): The unique identifier of the product in the wishlist that the customer wants to remove.

Authorization

The API requires a valid bearer token in the request header for authentication and user authorization. Users must provide a token to access their personalized wishlist.

Response Format

The API responds with a JSON object indicating the status of the wishlist removal request. If successful, it provides a success message.

Example Response:

Features

  • The Wishlist API allows customers to maintain a list of products they are interested in purchasing later.

  • Customers can view their wishlist, add products to it, and remove products from it as needed.

  • The API provides product information, such as the product ID, name, country variation ID, thumbnail, price, discount, and final price, to help customers make informed decisions.

Usage

  • The Get Wishlist API is used to retrieve the list of products in the customer's wishlist, displaying them on the wishlist page in the e-commerce application.

  • The Add to Wishlist API is utilized when customers browse the product catalog and find products they want to save for future reference.

  • The Remove from Wishlist API is used when customers decide to remove a product from their wishlist, keeping the list up-to-date with their preferences.

By offering wishlist management capabilities, the Wishlist API enhances the user experience, allowing customers to plan their purchases and keep track of products they intend to buy.

Last updated