cimplify

Catalogue

Products, categories, collections, bundles, composites, and price quotes.

TS
// Fetch products by category, get details, then quote a variant with add-ons
const products = await client.catalogue.getProducts({ category: 'cat_beverages', limit: 10 })
if (!products.ok) throw products.error

const detail = await client.catalogue.getProduct(products.value.items[0].id)
if (!detail.ok) throw detail.error

const quote = await client.catalogue.fetchQuote({
  product_id: detail.value.id,
  variant_id: 'var_large',
  quantity: 2,
  add_on_option_ids: ['addon_oat_milk', 'addon_extra_shot'],
  location_id: 'loc_main',
})
if (!quote.ok) throw quote.error

console.log(quote.value.quote_id, quote.value.expires_at)

getProducts

Returns a paginated list of products with optional filtering.

TS
const result = await client.catalogue.getProducts({
  category: 'cat_beverages',
  collection: 'col_summer',
  search: 'latte',
  featured: true,
  limit: 20,
})

if (result.ok) {
  console.log(result.value.items)        // Product[]
  console.log(result.value.is_complete)  // boolean
  console.log(result.value.pagination)   // pagination metadata
}
OptionTypeDescription
categorystringFilter by category ID
collectionstringFilter by collection ID
searchstringFull-text search query
featuredbooleanFeatured products only
limitnumberMax items to return

getProduct / getProductBySlug

TS
const byId = await client.catalogue.getProduct('prod_xxxxx')
const bySlug = await client.catalogue.getProductBySlug('iced-latte')

// Both return Result<ProductWithDetails> — includes variants, add-ons, images

Categories and Collections

TS
const categories = await client.catalogue.getCategories()   // Result<Category[]>
const collections = await client.catalogue.getCollections() // Result<Collection[]>
const collection = await client.catalogue.getCollection('col_xxxxx') // Result<Collection>

Bundles and Composites

Bundles are fixed product groupings. Composites let customers pick components (build-your-own).

TS
const bundle = await client.catalogue.getBundle('bun_xxxxx')
// Result<BundleDetails> — includes components and pricing

const composite = await client.catalogue.getComposite('comp_xxxxx')
// Result<CompositeDetails> — includes component options and constraints

Search

TS
const results = await client.catalogue.search('espresso')
// Result<Product[]> — convenience wrapper over getProducts({ search })

Price Quotes

Use quotes when variants, add-ons, bundles, or composites affect the final price. Quotes have an expires_at timestamp and must be refreshed if expired.

TS
// Fetch a new quote
const quote = await client.catalogue.fetchQuote({
  product_id: 'prod_xxxxx',
  variant_id: 'var_large',
  quantity: 2,
  add_on_option_ids: ['addon_oat_milk'],
  location_id: 'loc_main',
})
if (!quote.ok) throw quote.error

// Pass quote_id when adding to cart
await client.cart.addItem({
  item_id: 'prod_xxxxx',
  quantity: 2,
  variant_id: 'var_large',
  quote_id: quote.value.quote_id,
  add_on_options: ['addon_oat_milk'],
})

// Refresh an expired or changed quote
const refreshed = await client.catalogue.refreshQuote({
  quote_id: quote.value.quote_id,
  quantity: 3,
})
if (refreshed.ok) {
  console.log(refreshed.value.quote.quote_id)
}
fetchQuote InputTypeRequired
product_idstringYes
quantitynumberNo
variant_idstringNo
location_idstringNo
add_on_option_idsstring[]No
bundle_selectionsBundleSelection[]No
composite_selectionsCompositeSelection[]No

All Methods

MethodReturns
getProducts(opts?)Result<CatalogueResult<Product>>
getProduct(id)Result<ProductWithDetails>
getProductBySlug(slug)Result<ProductWithDetails>
getCategories()Result<Category[]>
getCollections()Result<Collection[]>
getCollection(id)Result<Collection>
getBundle(id)Result<BundleDetails>
getComposite(id)Result<CompositeDetails>
search(query)Result<Product[]>
fetchQuote(input)Result<PriceQuote>
refreshQuote(input)Result<{ quote: PriceQuote }>