Shop Screen (PLP)

It include filter, category, filter count and filter list API.

Shop API

The Shop API is a comprehensive set of endpoints that powers the shop view in the e-commerce application. It provides users with access to product listings, filtering options, and category-specific data to create a seamless shopping experience.

Shop main interface
Shop filter
Shop filter

Endpoint

  • {{baseurl}}/api/v1/product/get/filter

Method

  • GET

Request Parameters:

  • lang_code (optional): A two-letter language code (e.g., "en" for English, "ar" for Arabic, etc.) to support language-based localization. If provided, the API returns product information and filters in the specified language.

Request Body:

  • None

Authorization

The API requires a bearer token in the request header for authentication. Users need to include their valid bearer token in the "Authorization" header of the HTTP request to access the shop.

Response Format

The API responds with a JSON object containing filtered product data based on the user's preferences. The response includes an array of product objects with details such as product ID, name, price, and other product-related information.

Product count

Endpoint

  • {{baseurl}}/api/v1/product/filters/count

Method

  • POST

Request Parameters:

  • None

Request Body:

  • None

Authorization:

The API requires a bearer token in the request header for authentication. Users need to include their valid bearer token in the "Authorization" header of the HTTP request to access the filter count.

Response Format:

The API responds with a JSON object containing the count of available product filters. The response includes numerical data for each filter category, such as the count of available brands, sizes, colors, etc.

Product list

Endpoint

  • {{baseurl}}/api/v1/product/filters/list

Method

  • POST

Request Parameters:

  • lang_code (optional): A two-letter language code (e.g., "en" for English, "ar" for Arabic, etc.) to support language-based localization. If provided, the API returns filter category names and details in the specified language.

  • page (optional): The page number to retrieve when using pagination. If not specified, the API defaults to the first page.

Request Body:

  • variations (optional, array): An array of variations to filter products. For example, ["Color", "Size"].

  • categories (optional, array): An array of category IDs to filter products based on specific categories. For example, [1, 5, 10].

  • minPrice (optional, number): The minimum price value to filter products by price range.

  • maxPrice (optional, number): The maximum price value to filter products by price range.

  • sort (optional, string): Specifies the sorting order of the products. Possible values are "Popularity", "High to low price", "Low to high price", and "Newest first".

Authorization

The API requires a bearer token in the request header for authentication. Users need to include their valid bearer token in the "Authorization" header of the HTTP request to access the list of filters.

Response Format

The API responds with a JSON object containing the paginated filter category data. The response includes an array of filter objects for the requested page, along with pagination metadata.

Features:

  • The Shop API provides users with access to product listings, filter counts, and filter categories for a seamless shopping experience.

  • The lang_code parameter allows users to receive product and filter information in their preferred language for a more personalized experience.

  • Pagination in the filters/list endpoint helps users navigate through multiple pages of filter categories when the data is extensive.

Usage:

The Shop API is used to display products, filter options, and category-specific information to users while shopping on the e-commerce platform.

Last updated