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

Announcements

No record found.

News and Announcements icon
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
    Microsoft Employee 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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Mallesh Deshapaga Profile Picture

Mallesh Deshapaga 254

#2
Laurens vd Tang Profile Picture

Laurens vd Tang 188 Super User 2026 Season 1

#3
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 131 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans