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 Options

This endpoint is used for fetching related data that is useful to include in the product, such as reviews, ratings, categories, or any other related entities.
The includes parameter is an optional part of the FetchProductsQueryParams interface. It allows you to list related data that should be included in the response when fetching products. This way, you can get more detailed information in one request, without making multiple API calls.
TIP
The fetchOptions endpoint has been implemented in the fetch product endpoint, and It's all set up to save developer's time and effort.

Payload#

FetchOptionsPayload
array[number]
FetchOptionsPayload
optional
Pass a list of Product IDs

Response#

Success
Error
fetchOptions.product.success
status
number 
optional
Response Flag
success
enum<boolean> 
optional
Response Success
Allowed values:
200201202
data
object (Product) 
optional
id
integer 
optional
Id of the product.
name
string 
optional
Title for the product.
Example:
HUAWEI Band 6 Smart Band 96
description
string 
optional
Description of the product. May include HTML tags.
Example:
Light material for designed to your comfort while exercising.
url
string 
optional
Url link of the product.
promotion_title
string 
optional
Promotion title for the product.
subtitle
string 
optional
Subtitle for the product.
type
enum<string> 
optional
Type of the product.
Allowed values:
productservicegroup_productscodesdigitalfooddonating
status
enum<string> 
optional
Product status to indicate if it is available.
Allowed values:
saleout
weight
string  | null 
optional
Product weight is the total weight of a product and its packaging
calories
integer  | null 
optional
Product calories is to indicate calories in the product.
sku
string  | null 
optional
Product Stock Keeping Unit assigned to products to keep track of stock levels.
rating
object 
Rating | null
optional
Product rating.
price
number 
optional
The price of the product at its current state, which can be a regular or sale price.
sale_price
number 
optional
The discounted price of the product during a promotional sale or special offer.
regular_price
number 
optional
The standard or original price of the product before any discount or promotional offer is applied.
starting_price 
number 
optional
The starting price of the product.
Example:
Price start from ٨٣٠ ر.س
quantity
integer  | null 
optional
If it's null, means it's unlimited.
Example:
500
sold_quantity
integer 
optional
Quantity of the sold product.
Example:
450
max_quantity
integer 
optional
Maximum quantity of the product.
Example:
1000
discount_ends
string  | null 
optional
Ending period of the discount.
is_taxable
boolean 
optional
Is the tax included in the price
category
object 
optional
The product cateogry.
image 
object 
optional
Image of the product.
images
array [object {5}] 
optional
Images for a single product. Accessible for the single product page
brand
object 
optional
Brand of the product.
tags
array [object {2}] 
optional
Tags of the product.
options
object (ProductOption) 
optional
notify_availability
object  | null 
optional
Object for a single product notify-availability. Accessible for the single product page
donation
object 
object | null
optional
Object contains the details of the donation, if any; otherwise, it can be null.
has_read_more 
boolean 
optional
Show read more availability.
can_add_note  
boolean 
optional
Can add note availability.
can_show_sold
boolean 
optional
Availability to show sold products.
can_show_remained_quantity
boolean 
optional
Availability to show remaind quantity.
can_upload_file 
boolean 
optional
Can upload file availability.
has_custome_form
boolean 
optional
Is it for Food or Custom Service product.
has_options
boolean 
optional
Availability of product options.
is_on_sale
boolean 
optional
Is the product on sale.
is_hidden_quantity 
boolean 
optional
The quantity is hidden by merchant, or product not available.
is_available
boolean 
optional
Product availability.
is_donation
boolean 
optional
Donation availability.
is_in_wishlist 
boolean 
optional
Is the product added to any of the customer's wishlists.
is_out_of_stock
boolean 
optional
Is the product out of stock.
is_require_shipping
boolean 
optional
Does product require shipping.

Usage#

Define an array, productIds, and pass the product IDs. Then, call the salla.product.api.fetchOptions method from and pass in the productIds array. The method returns a promise, and the result, stored in productOptions, contains the options for the specified products.
📝 You can use the "fetch()" API with the "includes" query parameter to fetch a list of product options

Events#

This endpoint may trigger two events, the onProductOptionsFetched and onProductOptionsNotFetched events.

onProductOptionsFetched#

This event is triggered when the action of fetching product options is done without having any errors coming back from the backend.

onProductOptionsNotFetched#

This event is triggered when the action of fetching product options is not completed and an error has occurred.
Modified at 2024-07-03 11:04:08
Previous
Fetch
Next
Size Guides