web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Unanswered

How to refine search products using the retail server API in eCommerce?

(0) ShareShare
ReportReport
Posted on by 60

Hello experts!

We're trying to understand the Retail Server API a little better and as a small exercise, we're trying to get all products of a certain category under a certain price.

We were able to get the products belonging to a specific category by using searchByCategoryAsync, but we think it is naive to get All products from a category and do the filtering on the device.

So we tried to find a function that allows us to send filter parameters and have the server answer with the already-filtered information

Currently we think that refineSearchByCategoryAsync is exactly what we're looking for, but we get errors saying that we're not calling the API correctly.

We don't understand the interface - ProductRefinerValue extends SearchRefinerValue that is suggested to us by the IDE, and we tried all kinds of parameter combinations. Does anyone here know how to properly send filter requests to the server?

Here's the interface:

export interface ProductRefinerValue extends SearchRefinerValue { RefinerSourceValue?: number; SwatchImageUrl?: string; SwatchColorHexCode?: string; }

export interface SearchRefinerValue { RefinerRecordId?: number; DataTypeValue?: number; LeftValueBoundString?: string; RightValueBoundString?: string; UnitText?: string; RowNumber?: number; Count?: number; LeftValueBoundLocalizedString?: string; RightValueBoundLocalizedString?: string; ExtensionProperties?: CommerceProperty[]; }

And here's what we're trying right now:

refineSearchByCategoryAsync( { callerContext: this.props.context.actionContext }, this.props.context.request.apiSettings.channelId, this.props.context.request.apiSettings.catalogId, _categoryId,

[

{ // refiner goes here }           

 ])

.then(res => { console.log('refineSearchByCategoryAsync'); res.forEach(product => { console.log(JSON.stringify(product, null, 2)); }); }) .catch(e => console.error('error', e));

I have the same question (0)
  • Ramune Profile Picture
    on at

    Hi Cesar,

    As this question is related to the extension, I will leave it for the community to answer. Let's see if anybody has experienced the same and can advise for you anything.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Siv Sagar Profile Picture

Siv Sagar 283 Super User 2025 Season 2

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 213 Super User 2025 Season 2

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 152 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans