Get all products for one category
In the example below, we will make a request to get all products that belong to one category.
curl -X GET https://api.moltin.com/v2/products?filter=eq(category.id,XXXX) \
-H "Authorization: Bearer XXXX"
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X'
})
Moltin.Products.Filter({
eq: {
category: {
id: 'XXXX'
}
}
})
.With(["category"])
.All()
.then(products => {
// Do something
})
const { MoltinClient } = require('@moltin/request')
const client = new MoltinClient({
client_id: 'X'
})
client
.get('products?filter=eq(category.id,XXXX)')
.then(products => {
// Do something...
})
.catch(console.error)
let moltin = Moltin(withClientID: "<your client ID>")
moltin.product.filter(operator: .eq, key: "category.id", value: "xxxx").all {
response in
// Do something
}