DashForDevsDocs
DocsNewsAPI v1
dashfordevs.comSign in

© 2026 DashForDevs

DocsNewsdashfordevs.comLegalStatus
DocsProductsGet Product by Slug
Introduction
Getting Started
Authentication
Products
List ProductsGet Product by SlugProduct Variations & SizesSearch & FiltersCore & Options (Split Endpoints)Variation-as-Product PagesFreestyle BundlesProduct FilesProducts in Multiple Categories
Categories
Cart
Checkout
Blog
Reviews
Webhooks
Customers
Orders
Inventory
Shipping
Discounts
Affiliates
Email
Media & Files
Analytics & Tracking
Locations
Tax
Global Data
SEO
Error Handling
Geography
Finance
Automations
Page Types
Surveys
Billing & Subscriptions
Storefront Payments
SDK Reference
REST API
Storefront Architecture
Notifications
Security
Team & Permissions
Migrations & Import
Calendar & Appointments
Contact Forms
AI Bots
Dashboard API
Deployment
Changelog
Troubleshooting
Recipes
CLI & Deployment
Image Pipeline
White-label Platforms
Records Engine
Platform Modules
Platform Security
Site Keys & Client Sites
Use Cases
Operations

Get Product by Slug

Fetch a single product with full details and variations.

Updated March 29, 2026

On this page
  • Overview
  • SDK Usage
  • Split Loading (Recommended)
  • Full Product Response
  • REST API
  • Product Page Example
  • Next Steps

Overview

Fetch a single product with its full details including description, images, variations, sizes, reviews summary, and related products.

SDK Usage

typescript
import dash from "@/lib/dash"

const { product } = await dash.products.get("blue-dream")

Split Loading (Recommended)

For faster page loads, split the request into a lightweight server fetch and a heavier client fetch:

typescript
// Server component — fast initial render
const { product } = await dash.products.getCore("blue-dream")
// Returns: name, price, images, description (no variations/sizes)

// Client component — load interactive data
const { options } = await dash.products.getOptions("blue-dream")
// Returns: variations, sizes, bulk discounts

This pattern lets you render the page shell on the server while loading the variation picker on the client. See Data Fetching for more on this pattern.

Full Product Response

json
{
  "id": "prod_abc123",
  "name": "Blue Dream",
  "slug": "blue-dream",
  "description": "<p>Premium quality...</p>",
  "main_image": "https://cdn.dashfordevs.com/...",
  "price": "29.99",
  "discounted_price": "24.99",
  "in_stock": true,
  "avg_rating": 4.7,
  "reviews_count": 42,
  "images": [
    { "id": "img_1", "image": "https://...", "alt_text": "Front view", "order": 0 }
  ],
  "attributes": [
    {
      "id": "attr_strain",
      "name": "Strain",
      "options": [
        {
          "id": "opt_bd",
          "value": "Blue Dream",
          "slug": "blue-dream",
          "description": "Sativa-dominant hybrid",
          "main": true,
          "image": "https://...",
          "sizes": [
            {
              "id": "size_1g",
              "label": "1g",
              "price": "29.99",
              "discounted_price": "24.99",
              "stock": 50,
              "in_stock": true,
              "bulk_discounts": [
                { "min_quantity": 5, "discount_type": "percentage", "discount_value": "10" }
              ]
            }
          ]
        }
      ]
    }
  ],
  "features": ["Lab tested", "Organic"],
  "qna": [{ "question": "Is this organic?", "answer": "Yes." }],
  "related": [{ "id": "prod_def", "name": "OG Kush", "slug": "og-kush", "price": "34.99" }],
  "category": { "id": "cat_xyz", "name": "Flower", "slug": "flower" },
  "custom_fields": {}
}

REST API

shell
GET /storefront/products/blue-dream
X-API-Key: pk_live_your_key

Product Page Example

typescript
// app/products/[slug]/page.tsx
import dash from "@/lib/dash"

export default async function ProductPage({ params }) {
  const { product } = await dash.products.getCore(params.slug)

  return (
    <div>
      <img src={product.main_image} alt={product.name} />
      <h1>{product.name}</h1>
      <p>${product.discounted_price || product.price}</p>
      <div dangerouslySetInnerHTML={{ __html: product.description }} />
      <VariationPicker slug={params.slug} />
    </div>
  )
}

Next Steps

  • Product Variations & Sizes — Understanding the variation/size structure
  • Get Product Reviews — Displaying product reviews
  • Product SEO — Meta tags for product pages
  • Recipe: Build a Product Page — Full walkthrough
PreviousList ProductsNextProduct Variations & Sizes

On this page

  • Overview
  • SDK Usage
  • Split Loading (Recommended)
  • Full Product Response
  • REST API
  • Product Page Example
  • Next Steps