Salla Docs
Merchant API
  • Merchant API
  • Salla OAuth 2.0
Partner APIs
  • App API
  • Shipment API
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Change Log
Salla CLI
Merchant API
  • Merchant API
  • Salla OAuth 2.0
Partner APIs
  • App API
  • Shipment API
Storefront
  • Twilight Engine
  • Twilight SDK
  • Web Components
  • Change Log
Salla CLI
Salla - Opensource
Salla - Developers Community
  1. Product
  • Overview
  • Languages
  • Notify
  • Event
  • Storage
  • Configuration
  • Forms
  • Helpers
  • Auth
    • Login
    • Logout
    • Verify
    • Resend
    • Register
    • Refresh
  • Cart
    • Latest
    • Details
    • Quick Add
    • Add Item
    • Delete Item
    • Delete Image
    • Add Coupon
    • Remove Coupon
    • Get Upload Image
    • Get Quick Order Settings
    • Create Quick Order
    • Order Status
    • Get Current Cart Id
    • Price Quote
  • Wishlist
    • Add
    • Remove
    • Toggle
  • Loyalty
    • Get Program
    • Exchange
    • Reset
  • Comment
    • Add Comment
    • Fetch
    • Get Page Comments
    • Get Product Comments
  • Profile
    • Update profile
    • Update contact
  • Product
    • Get price
    • Product availability
    • Categories
    • Offer details
    • Search products
    • Get Gift Details
    • Add Gift To Cart
    • Upload Gift Image
    • Get Product Details
    • Fetch
    • Fetch Options
    • Size Guides
  • Order
    • Create cart from order
    • Cancel
    • Send invoice
    • Show order
  • Booking
    • Add
  • Rating
    • Order
    • Store
    • Products
    • Shipping
  • Currency
    • Change
    • List
  • Component
    • Reviews
    • Menus
  1. Product

Search products

A search query is group of keywords that a customer enters to satisfy their information needs. This endpoint enables the customer to enter a phrase or a keyword combination to find a product list of interest.
TIP
The search products endpoint has been implemented in the Search Web Component, and It's all setup to save developer's time and effort.

Payload#

SearchProductsPayload
keyword
string 
required
A keyword string that a customer enters to find related products.
query
string 
required
A query string that a customer enters to find related products.
type
enum<string> 
optional
Search type. By default is set to 'keyword'.
Allowed values:
keywordtag
Default:
keyword
sort_by
enum<string> 
optional
Sorting type for the products list
Allowed values:
ourSuggestdefaultbestSelltopRatedpriceFromTopToLow
per_page
number 
optional
Number of displayed products per page
Default:
32
Example:
max 50
brands
array[number]
optional
The scope of brands to search within using a keyword.
categories
array[number]
optional
The scope of categories to search within using a keyword.
<= 5 items
branches
array[number]
optional
The scope of branches to search within using a keyword.
<= 5 items

Response#

Success
Error
products.searchProducts.success
success
boolean 
success
required
Response flag
status
enum<number> 
status
required
Allowed values:
200201202
data
object 
data
optional
Search response data
data
array[object (Product) {15}] 
data
required
List of the fetched products
cursor
object 
cursor
required
Products' pagination cursor which is responsible for records' cursor position.
features
object 
features
optional
Sorting features
sort_options
array [object {2}] 
sort_options
required
Sorting options

Usage#

To perform the action of searching for products using a query string, the developer may call the method products() as follows;

Events#

This endpoint may trigger two events, the onSearchResults and onSearchFailed events.

onSearchResults#

This event is triggered when searching for products using a query string is done without having any errors coming back from the backend.

onSearchFailed#

This event is triggered when searching for products using a query string is not completed and an error has occurred.
Modified at 2025-03-04 12:54:02
Previous
Offer details
Next
Get Gift Details