Stock Management
Track inventory levels and stock alerts.
Updated
On this page
Overview
Stock is tracked at the size level. Each product size has its own inventory count. When a customer purchases an item, stock is automatically decremented.
Reading Stock
import dash from "@/lib/dash"
const { product } = await dash.products.get("blue-dream")
product.attributes.forEach(attr => {
attr.options.forEach(option => {
option.sizes.forEach(size => {
console.log(`${option.value} ${size.label}: ${size.stock} in stock (${size.in_stock})`)
})
})
})