Fetch Options
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
Payload
FetchOptionsPayload
array[number]
FetchOptionsPayload
Response
Success
Error
fetchOptions.product.success
status
number
optional
success
enum<boolean>
optional
Allowed values:
200201202
data
object (Product)
optional
id
integer
optional
name
string
optional
Example:
HUAWEI Band 6 Smart Band 96
description
string
optional
Example:
Light material for designed to your comfort while exercising.
url
string
optional
promotion_title
string
optional
subtitle
string
optional
type
enum<string>
optional
Allowed values:
productservicegroup_productscodesdigitalfooddonating
status
enum<string>
optional
Allowed values:
saleout
weight
string | null
optional
calories
integer | null
optional
sku
string | null
optional
rating
object
Rating | null
price
number
optional
sale_price
number
optional
regular_price
number
optional
starting_price
number
optional
Example:
Price start from ٨٣٠ ر.س
quantity
integer | null
optional
Example:
500
sold_quantity
integer
optional
Example:
450
max_quantity
integer
optional
Example:
1000
discount_ends
string | null
optional
is_taxable
boolean
optional
category
object
optional
image
object
optional
images
array [object {5}]
optional
brand
object
optional
tags
array [object {2}]
optional
options
object (ProductOption)
optional
notify_availability
object | null
optional
donation
object
object | null
has_read_more
boolean
optional
can_add_note
boolean
optional
can_show_sold
boolean
optional
can_show_remained_quantity
boolean
optional
can_upload_file
boolean
optional
has_custome_form
boolean
optional
Food
or Custom Service
product.has_options
boolean
optional
is_on_sale
boolean
optional
is_hidden_quantity
boolean
optional
is_available
boolean
optional
is_donation
boolean
optional
is_in_wishlist
boolean
optional
is_out_of_stock
boolean
optional
is_require_shipping
boolean
optional
Usage
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
onProductOptionsFetched
onProductOptionsNotFetched
Modified at 2024-07-03 11:04:08