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

Fetch

This endpoint is used for fetching product lists from a Merchant Store. The endpoint accepts query parameters that are validated to ensure they are of the correct data type. If the validation succeeds, a GET request is made to the API endpoint and the response is returned. If the validation fails, an error message is returned via a Promise.
TIP
The fetch endpoint has been implemented in the Product List Web Component, and It's all setup to save developer's time and effort.

Payload#

FetchPayload
source
enum<string> 
required
This field indicates the source of the product list to fetch.
Allowed values:
categorieslatestrelatedbrandsjsonsearchtagsselectedofferslanding-page
sourceValue
string  | number  | object  | array 
required
This field specifies the value of the source field. The type of this field varies depending on the value of the source field.
filters
object 
optional
This field allows additional filters to be applied to the product list. The filters are specified as an object with filter names as keys and filter values as values. The available filter names and values depend on the store's configuration.
limit
number 
optional
This field specifies the maximum number of products to include in the product list. If not specified, the default limit is used.
includes
array[string]
optional
This field specifies the related data entities that should be included in the response when fetching products.
📝 The only supported value is ["options"], which uses the "salla.product.api.fetchOptions" API to include the products' options for each fetched products

Response#

Success
Error
product.fetch.success
success
boolean 
success
required
Response flag
status
enum<number> 
status
required
Allowed values:
200201202
data
array[object (ProductDetail) {51}] 
Data is available when the success is `true`
optional
id
number 
optional
This field contains the unique identifier for the product.
promotion
object 
optional
This field contains information about any current promotions for the product.
sku
string 
optional
This field contains the product's SKU (stock keeping unit) number.
mpn
string 
optional
This field contains the product's manufacturer part number.
gtin
string 
optional
This field contains the product's global trade item number.
type
string 
optional
This field contains the type of product.
name
string 
optional
This field contains the name of the product.
short_link_code
string 
optional
This field contains the short link code for the product.
urls
object 
optional
This field contains URLs for the customer-facing and admin-facing pages for the product.
price
object 
optional
This field contains the current price of the product.
taxed_price
object 
optional
This field contains the price of the product after taxes.
pre_tax_price
object 
optional
This field contains the price of the product before taxes.
tax
object 
optional
This field contains the amount of taxes applied to the product.
description
string 
optional
This field contains a description of the product.
quantity
string 
optional
This field contains the quantity of the product available for sale.
status
string 
optional
This field contains the status of the product.
is_available
boolean 
optional
This field indicates whether the product is currently available for purchase.
views
string 
optional
This field contains the number of views the product has received.
sale_price
object 
optional
This field contains the sale price of the product, if applicable.
sale_end
string 
optional
This field contains the end date of any current sales for the product.
require_shipping
boolean 
optional
This field indicates whether the product requires shipping.
cost_price
string 
optional
This field contains the cost of the product.
weight
number 
optional
This field contains the weight of the product.
weight_type
string 
optional
This field contains the type of weight measurement used for the product.
weight_label
string 
optional
This field contains the label for the product's weight.
with_tax
boolean 
optional
This field indicates whether taxes are included in the product price.
included_tax
boolean 
optional
This field indicates whether the tax amount is included in the product price.
url
string 
optional
This field contains the URL for the product's page.
main_image
string 
optional
This field contains the URL of the product's main image.
images
array[object (images)] 
optional
This field contains an array of additional images for the product.
show_purchase_count
string 
optional
This field indicates whether the product's purchase count is displayed.
sold_quantity
number 
optional
This field contains the number of units of the product that have been sold.
sold_quantity_desc
string 
optional
This field contains a description of the product's sold quantity.
rating
object 
Rating
optional
This field contains information about the product's rating.
favorite
string 
optional
This field contains information about whether the product has been favorited.
has_special_price
boolean 
optional
This field indicates whether the product has a special price.
regular_price
object 
optional
This field contains the regular price of the product.
features
object 
optional
This field contains information about the features of the product.
maximum_quantity_per_order
number 
optional
This field contains the maximum quantity of the product that can be ordered per order.
show_in_app
boolean 
optional
This field indicates whether the product is shown in the app.
has_size_guide
boolean 
optional
This field indicates whether the product has a size guide.
notify_quantity
string 
optional
This field contains the quantity at which to notify customers of low stock.
hide_quantity
boolean 
optional
This field indicates whether the product quantity is hidden.
unlimited_quantity
boolean 
optional
This field indicates whether the product has unlimited stock.
managed_by_branches
boolean 
optional
This field indicates whether the product is managed by branches.
services_blocks
object 
optional
This field contains information about services associated with the product.
calories
string 
optional
This field contains information about the calories in the product.
customized_sku_quantity
boolean 
optional
This field indicates whether the SKU quantity for the product is customizable.
options
array[object (Option) {17}] 
optional
This field contains an array of options associated with the product.
skus
array [object {14}] 
optional
This field contains an array of SKUs associated with the product.
tags
array [object] 
optional
This field contains an array of tags associated with the product.

Usage#

To perform the action of retrieving a list of products, the developer may call the method fetch() as follows. For this method we define the query parameters as an object with a source property of categories and a source_value property of an array [1, 2, 3]. We then call the fetch() method of the salla.product object and pass in the query parameters as an argument.

Events#

This endpoint may trigger two events, the onProductListFetchSucceeded and onProductListFetchFailed events.

onProductListFetchSucceeded#

This event is triggered when the action of retrieving a list of products is done without having any errors coming back from the backend.

onProductListFetchFailed#

This event is triggered when the action of retrieving a list of products is not completed and an error has occurred.
Modified at 2025-03-04 12:54:02
Previous
Get Product Details
Next
Fetch Options