Like

Last updated 9 months ago

Begins with

In the example below we will make a request to get all products where the SKU begins with SHOE_DECK.

cURL
JavaScript SDK
Swift SDK
curl -X GET https://api.moltin.com/v2/products?filter=like(sku,SHOE_DECK_*) \
-H "Authorization: Bearer XXXX"
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X'
})
Moltin.Products.Filter({ like: { sku: 'SHOE_DECK_*' } })
.All()
.then(products => {
// Do something
})
let moltin = Moltin(withClientID: "<your client ID>")
moltin.product.filter(operator: .like, key: "sku", value: "SHOE_DECK_*").all {
// Do something
}

Contains

In the example below we will make a request to get all products where the SKU contains _DECK_.

cURL
JavaScript SDK
Swift SDK
curl -X GET https://api.moltin.com/v2/products?filter=like(sku,*_DECK_*) \
-H "Authorization: Bearer XXXX"
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X'
})
Moltin.Products.Filter({ like: { sku: '*_DECK_*' } })
.All()
.then(products => {
// Do something
})
let moltin = Moltin(withClientID: "<your client ID>")
moltin.product.filter(operator: .like, key: "sku", value: "*_DECK_*").all {
// Do something
}

Ends with

In the example below we will make a request to all all products where the SKU ends with _RED.

cURL
JavaScript SDK
Swift SDK
curl -X GET https://api.moltin.com/v2/products?filter=like(sku,*_RED) \
-H "Authorization: Bearer XXXX"
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
client_id: 'X'
})
Moltin.Products.Filter({ like: { sku: '*_RED' } })
.All()
.then(products => {
// Do something
})
let moltin = Moltin(withClientID: "<your client ID>")
moltin.product.filter(operator: .like, key: "sku", value: "*_RED").all {
// Do something
}