GlassHouse Docs Support
Custom stores

Map your product catalogue

Give GlassHouse the products your shoppers can discover and buy.

Implement two lookups

store-integration.ts
import type { StoreAdapter } from '@superseeded/glasshouse/types'
import { catalogue } from './your-store'

export const adapter: StoreAdapter = {
  catalogue: () => catalogue.listGlassHouseProducts(),
  getProducts: (ids, context) =>
    catalogue.getGlassHouseProducts(ids, context?.shopperId),
}

The methods on catalogue above belong to your store. Map their records to StoreProduct, shown below.

catalogue() returns the complete discovery catalogue. Handle pagination inside the adapter. getProducts() reloads current price and availability for the requested IDs and omits products the shopper cannot access.

Signed agent lookups have no shopper context: return public products for those requests.

Return a StoreProduct

Product record
import type { StoreProduct } from '@superseeded/glasshouse/types'

const product: StoreProduct = {
  id: 'lavender-2l',
  name: 'Lavender · 2 litre pot',
  url: 'https://store.example/plants/lavender-2l',
  imageUrl: 'https://store.example/images/lavender.webp',
  price: { amount: 14.50, currency: 'GBP' },
  available: true,
  published: true,
  stockQuantity: 24,
}

Each purchasable size or variant needs its own stable ID. String IDs and positive integer IDs are supported; use the same type everywhere.

FieldMeaning
idThe purchasable offer or variant, not a shared parent ID.
url, imageUrlAbsolute HTTP(S) URLs. Use an empty image URL when no image is available.
priceNumeric amount in currency units, with an uppercase three-letter currency code.
published, availableWhether the product can be shown and purchased.
stockQuantityOptional available quantity. Omit or use null when untracked.
Variant and quantity fields

Use optional productId for the parent product, variantId for the store variant and sku for your stock code.

minimumQuantity and quantityStep are positive integers. Valid quantities start at the minimum and increase by the step. IDs must be unique and non-empty; the string "0" is reserved.

Add reviewed plant facts

Include reviewed botanical information in plant. Add speciesId when you already have a canonical species identity. Reuse the plant facts and image assets from your existing Catalog/API workflow.

Optional plant fields
product.plant = {
  speciesName: 'Lavandula angustifolia',
  heightMeters: 0.6,
  widthMeters: 0.6,
  sunExposure: ['full sun'],
  waterPreference: ['dry'],
  soilType: ['well drained'],
}

These values illustrate the format; supply dimensions and growing conditions reviewed for your actual product. Leave unknown facts unset. Layout spacing uses mature width in metres.

Recommendation and layout details

The default core uses recorded growing conditions, mature dimensions and stock. Optional facts include soilPh, droughtTolerant, flowerColours and toxicity (known_toxic, reviewed_non_toxic or unknown).

Unknown facts do not satisfy an explicit growing-condition constraint. Supply adapter.layouts(input, products) to use your own authoritative layout engine, including any climate, season or design rules your store requires.

Tab to a result, then press Enter to open it.