Skip to main content

Notifications

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));

  • Ramune Profile Picture
    on at
    RE: How to refine search products using the retail server API in eCommerce?

    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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Zain Mehmood Profile Picture

Zain Mehmood 462 Moderator

#2
Danny Bilodeau Profile Picture

Danny Bilodeau 156 Moderator

#3
Laurens vd Tang Profile Picture

Laurens vd Tang 120 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans