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

Response#

Success
Error
fetchOptions.product.success

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