Skip to content

Filtering stock of products (where it's > 0) #386

Closed Answered by logeshswell
kolbykruger asked this question in Help
Discussion options

You must be logged in to vote

Yes, it is possible to filter products where the stock > 0.

import swell from 'swell-js'

swell.init('<store-id>', '<public_key>');

const response = await swell.products.list({
  stock_status: 'in_stock'
});

// Alternate way
const response = await swell.products.list({
  stock_level: {
    $gt: 0
  },
});

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by logeshswell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
2 participants