HOWTO Filter listProducts Results On Inventory Stock Level

(Doc ID 2332458.1)

Last updated on NOVEMBER 30, 2017

Applies to:

Oracle Commerce Cloud Service - Version N/A and later
Information in this document applies to any platform.

Goal

The project has a requirement is to only display products whose inventory is greater than 0.  Data returned from a search navigation response offer childSkus.quantity in the viewmodel, but the listProducts REST endpoint does not include inventory details. Filtering products in widget code produces a bad customer experience because of pagination. Pagination operates based on the totalResults attribute which doesn't have access to inventory values. For example there might be totalResult = 144 but actually 123 products that are in stock i.e quantity > 0.

Solution

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms