Hanzo
PlatformCommerce

Products

Product catalog management

Products

Hanzo Commerce supports flexible product types with variants, metadata, and pricing tiers.

Product Types

TypeDescriptionUse Case
physicalShippable goodsHardware, merchandise
digitalDigital downloadsSoftware, assets
subscriptionRecurring billingSaaS plans
creditsUsage-based creditsAPI tokens, compute

Create Product

const product = await commerce.products.create({
  name: 'API Plan',
  type: 'subscription',
  description: 'AI inference API access',
  metadata: {
    tier: 'pro',
    features: ['priority-support', 'higher-limits']
  }
})

Product Variants

Variants represent different configurations of a product (pricing tiers, sizes, etc.).

const product = await commerce.products.create({
  name: 'API Plan',
  type: 'subscription',
  variants: [
    { name: 'Starter', price: 29, interval: 'month', metadata: { calls: 10000 } },
    { name: 'Pro', price: 99, interval: 'month', metadata: { calls: 100000 } },
    { name: 'Enterprise', price: 299, interval: 'month', metadata: { calls: 'unlimited' } }
  ]
})

List Products

const products = await commerce.products.list({
  type: 'subscription',
  active: true,
  limit: 20
})

Update Product

await commerce.products.update(product.id, {
  price: 39.99,
  metadata: { featured: true }
})

Delete Product

await commerce.products.delete(product.id)

How is this guide?

Last updated on

On this page