انتقل إلى المحتوى الرئيسي

Search Product

the Search Product eCommerce API documentation. This API allows you to search for products within our eCommerce platform. You can retrieve detailed information about products, such as their name, price, description, and availability.

  • Endpoint: api/customer/products/search

  • Http Method: POST

  • Request Body:

KeyTypeDescription
qStringIt allows you to specify a keyword to search for within the products.
brand_idsArrayAn array that allows you to filter products by specific brand IDs. You can provide one or more brand IDs to narrow down the search results to products from those brands.
sub_categories_slugsArrayAn array that allows you to filter products by specific sub-category slugs.
categoriesArrayAn array that allows you to filter products by specific category IDs. You can provide one or more category IDs to restrict the search results to products within those categories.
category_slugstringFilter products by a specific category slug.
price_fromIntegerThe minimum price of the products you want to search for. You can set a numeric value to filter products with prices equal to or higher than the specified value.
price_toIntegerThe maximum price of the products you want to search for. You can set a numeric value to filter products with prices equal to or lower than the specified value.
pageIntegerThe page number of the search results. It is commonly used for pagination, allowing you to retrieve a specific page of results.
page_sizeIntegerThe number of products to be returned per page. It controls the size of each page of search results.
sortIntegerA sorting criteria for the search results. You can define how the products should be sorted, such as by price, name, or any other relevant attribute.
group_slugsArrayAn array that allows you to filter products based on specific group slug.
list_idsArrayAn array that allows you to filter products based on specific list IDs. You can provide one or more list IDs to narrow down the search results to products within those lists.
promotionsArrayA boolean flag that indicates whether you want to include promotions in the search results. If set to true, promotions will be included; if set to false, promotions will be excluded.
in_stockIntegerThis parameter allows you to filter products based on their availability. You can specify values like "true" or "false" to search for products that are in stock or out of stock, respectively.
vendor_idIntegerFilter prices of products by a vendor ID. It restricts the search results to prices within the specified vendor.
نصيحة

When the ENABLE_SEARCH_SIDE_FILTERS configuration is disable, sending a request to the API will hide the sidebar, providing a streamlined search experience without filtering options.

  • Query Parameters:
KeyTypeDescription
enable_search_side_filtersBooleanThis parameter allows you to control the visibility of sidebar filters. When set to true, the API response will include sidebar details.
  • Success Response:
KeyTypeDescription
totalIntegerThe total number of products that match the search criteria.
total_productsIntegerThe total number of products that match the search criteria.
min_priceIntegerThe minimum price of the products that match the search criteria.
max_priceIntegerThe maximum price of the products that match the search criteria.
productsArrayAn array of products that match the search criteria.
products_optionsArrayAn array of products options that match the search criteria.
sub_categoriesArrayAn array of sub-categories that match the search criteria.
brandsArrayAn array of brands that match the search criteria.
200 OK - If the request was successful
{
"code": 200,
"data": {
"total": 23,
"total_products": 228,
"min_price": 149,
"max_price": 3499,
"products": [
{
"id": 2253,
"brand": {
"id": 37,
"name": "Honor",
"name_ar": "هونر",
"name_en": null,
"image": "https://etisal-storeapi.supercommerce.io/storage/uploads/gn2Ajs-1615981987.png"
},
"parent_id": null,
"sku": "main_Honor_X9a",
"slug": "Honor-X9a",
"name": "Honor X9a",
"name_en": "Honor X9a",
"name_ar": "هونر X9a",
"image": "https://docapi.supercommerce.io/storage/uploads/1-honor-x9a-8gb-256gb-midnight-black-1689769189.webp",
"price": 16777,
"discount_price": 16499,
"direct_discount": true,
"category": {
"id": 1081,
"name": "Mobiles",
"name_ar": "موبايل",
"slug": "mobiles",
"sub_categories": [
{
"id": 1089,
"name": "Honor",
"name_ar": "هونر",
"slug": "honor"
}
]
},
"type": 1,
"product_variants_options": [
{
"option": {
"id": 122,
"name": "Color",
"name_ar": "اللون",
"name_en": "Color",
"description": null,
"type": "4",
"preview_type": 1,
"default": false,
"order": 10
},
"values": [
{
"id": 107,
"name": "Black",
"image": "https://docapi.supercommerce.io/storage/uploads/1-honor-x9a-8gb-256gb-midnight-black-1689769205.webp",
"color_code": "#000000"
},
{
"id": 116,
"name": "Green",
"image": "https://docapi.supercommerce.io/storage/uploads/1-honor-x9a-8gb-256gb-emereld-green-1689773008.webp",
"color_code": "#00FF00"
},

"id": 108,
"name": "Silver",
"image": "https://docapi.supercommerce.io/storage/uploads/1-honor-x9a-8gb-256gb-titanuim-silver-1689773164.webp",
"color_code": "#C0C0C0"
}
]
}
],
"product_variants": [
{
"id": 2254,
"name": "Honor X9a 8GB RAM 256GB - Midnight Black",
"slug": "honor-x9a-black",
"share_link": "https://doc.supercommerce.io/en/honor-x9a-black",
"name_en": "Honor X9a 8GB RAM 256GB - Midnight Black",
"name_ar": "هونر X9a رام 8 جيجا بايت - مساحة 256 جيجا بايت - اسود",
"sku": "5109ANPY",
"barcode": null,
"price": 16777,
"discount_price": 16499,
"stock": 10,
"image": "https://docapi.supercommerce.io/storage/uploads/1-honor-x9a-8gb-256gb-midnight-black-1689769189.webp",
"parent_id": 2253,
}
],
"active": true,
//...
}
],
"products_options": [],
"sub_categories": [],
"brands": [],
}
}
معلومات

Check the following section to learn more about the Search Product API Reference