> ## Documentation Index
> Fetch the complete documentation index at: https://spreecommerce.org/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Retrieve a Product

> Returns Product details. You can use product permalink:

```
GET /api/v2/storefront/products/knitted-high-neck-sweater
```

Or Product ID:

```
GET /api/v2/storefront/products/21
```

**Note** API will attempt a permalink lookup before an ID lookup.



## OpenAPI

````yaml /api-reference/storefront.yaml get /api/v2/storefront/products/{product_slug}
openapi: 3.0.3
info:
  version: 2.0.0
  title: Storefront API
  description: >-
    Storefront API is a modern REST API based on the [JSON API
    spec](https://jsonapi.org/) which provides you with all the necessary
    endpoints to build amazing user interfaces either in JavaScript frameworks
    or native mobile libraries.


    Import to
    [Postman](https://raw.githubusercontent.com/spree/spree/main/docs/api-reference/storefront.yaml)
  contact:
    name: Vendo Connect Inc.
    url: https://spreecommerce.org
    email: hello@spreecommerce.org
  license:
    name: BSD-3-Clause
    url: https://github.com/spree/spree/blob/main/LICENSE.md
servers:
  - url: https://demo.spreecommerce.org
    description: demo
  - url: http://localhost:3000
    description: localhost
security: []
tags:
  - name: Account
  - name: Account / Address
  - name: Account / Credit Cards
  - name: Account / Orders
  - name: Cart
  - name: Cart / Line Items
  - name: Cart / Coupons
  - name: Cart / Other
  - name: Checkout
  - name: Checkout / State
  - name: Checkout / Shipments
  - name: Checkout / Payments
  - name: Checkout / Store Credit
  - name: Stripe
  - name: Adyen
  - name: Countries
  - name: Digital Downloads
  - name: Order Status
  - name: Products
  - name: Variants
  - name: Stores
  - name: Policies
  - name: Taxons
  - name: Vendors
  - name: Wishlists
  - name: Wishlists / Wished Items
paths:
  /api/v2/storefront/products/{product_slug}:
    get:
      tags:
        - Products
      summary: Retrieve a Product
      description: |-
        Returns Product details. You can use product permalink:

        ```
        GET /api/v2/storefront/products/knitted-high-neck-sweater
        ```

        Or Product ID:

        ```
        GET /api/v2/storefront/products/21
        ```

        **Note** API will attempt a permalink lookup before an ID lookup.
      operationId: show-product
      parameters:
        - $ref: '#/components/parameters/ProductSlug'
        - $ref: '#/components/parameters/ProductIncludeParam'
        - $ref: '#/components/parameters/SparseFieldsProduct'
        - $ref: '#/components/parameters/ProductImageTransformationSizeParam'
        - $ref: '#/components/parameters/ProductImageTransformationQualityParam'
      responses:
        '200':
          $ref: '#/components/responses/Product'
        '404':
          $ref: '#/components/responses/404NotFound'
components:
  parameters:
    ProductSlug:
      name: product_slug
      in: path
      required: true
      description: Product Slug
      schema:
        type: string
      example: knitted-high-neck-sweater
    ProductIncludeParam:
      name: include
      in: query
      schema:
        type: string
      description: >-
        Specify what related resources (relationships) you would like to receive
        in the response body. Eg.


        ```

        default_variant,variants,option_types,product_properties,taxons,images,primary_variant

        ```


        [More information](https://jsonapi.org/format/#fetching-includes)
      example: >-
        default_variant,variants,option_types,product_properties,taxons,images,primary_variant
    SparseFieldsProduct:
      name: fields[product]
      in: query
      description: >-
        Specify the fields you would like returned in the response body. [More
        information](https://jsonapi.org/format/#fetching-sparse-fieldsets).
      schema:
        type: string
      example: price,description,name
    ProductImageTransformationSizeParam:
      in: query
      name: image_transformation[size]
      schema:
        type: string
      example: 100x50
      description: Specifies dimensions for included images at transformed_url attribute.
    ProductImageTransformationQualityParam:
      in: query
      name: image_transformation[quality]
      schema:
        type: string
      example: '70'
      description: Specifies quality for included images at transformed_url attribute
  responses:
    Product:
      description: 200 Success - Returns the `product` object.
      content:
        application/vnd.api+json:
          schema:
            type: object
            properties:
              data:
                $ref: '#/components/schemas/Product'
              included:
                type: array
                items:
                  $ref: '#/components/schemas/ProductIncludes'
            required:
              - data
          examples:
            Single Product:
              value:
                data:
                  id: '96'
                  type: product
                  attributes:
                    name: Bomber Jacket
                    description: >-
                      Dolorem nulla odit nostrum placeat soluta non vitae
                      praesentium. Neque asperiores quos necessitatibus sint
                      placeat. Voluptas aliquid atque veniam iste assumenda
                      blanditiis. Excepturi odit recusandae laboriosam sunt
                      temporibus corrupti. Tempore necessitatibus recusandae
                      eligendi occaecati nesciunt sed illum similique.
                    available_on: '2021-10-02T11:02:29.288Z'
                    slug: bomber-jacket
                    meta_description: null
                    meta_keywords: null
                    updated_at: '2021-10-02T11:03:14.681Z'
                    sku: JacketsandCoats_bomberjacket_38.99
                    purchasable: true
                    in_stock: true
                    backorderable: false
                    available: true
                    currency: USD
                    price: '38.99'
                    display_price: $38.99
                    compare_at_price: null
                    display_compare_at_price: null
                    localized_slugs:
                      en: bomber-jacket
                      de: bomberjacke
                      fr: blouson
                    tags:
                      - bomber
                      - jacket
                      - winter
                    labels:
                      - new
                      - sale
                  relationships:
                    variants:
                      data:
                        - id: '212'
                          type: variant
                    option_types:
                      data:
                        - id: '1'
                          type: option_type
                        - id: '3'
                          type: option_type
                    product_properties:
                      data:
                        - id: '639'
                          type: product_property
                        - id: '640'
                          type: product_property
                        - id: '641'
                          type: product_property
                        - id: '642'
                          type: product_property
                        - id: '643'
                          type: product_property
                        - id: '644'
                          type: product_property
                        - id: '645'
                          type: product_property
                        - id: '646'
                          type: product_property
                    taxons:
                      data:
                        - id: '19'
                          type: taxon
                        - id: '14'
                          type: taxon
                        - id: '24'
                          type: taxon
                        - id: '3'
                          type: taxon
                    images:
                      data: []
                    default_variant:
                      data:
                        id: '212'
                        type: variant
                    primary_variant:
                      data:
                        id: '96'
                        type: variant
            Product with Includes:
              value:
                data:
                  id: '96'
                  type: product
                  attributes:
                    name: Bomber Jacket
                    description: >-
                      Dolorem nulla odit nostrum placeat soluta non vitae
                      praesentium. Neque asperiores quos necessitatibus sint
                      placeat. Voluptas aliquid atque veniam iste assumenda
                      blanditiis. Excepturi odit recusandae laboriosam sunt
                      temporibus corrupti. Tempore necessitatibus recusandae
                      eligendi occaecati nesciunt sed illum similique.
                    available_on: '2021-10-02T11:02:29.288Z'
                    slug: bomber-jacket
                    meta_description: null
                    meta_keywords: null
                    updated_at: '2021-10-02T11:03:14.681Z'
                    sku: JacketsandCoats_bomberjacket_38.99
                    purchasable: true
                    in_stock: true
                    backorderable: false
                    available: true
                    currency: USD
                    price: '38.99'
                    display_price: $38.99
                    compare_at_price: null
                    display_compare_at_price: null
                  relationships:
                    variants:
                      data:
                        - id: '212'
                          type: variant
                    option_types:
                      data:
                        - id: '1'
                          type: option_type
                        - id: '3'
                          type: option_type
                    product_properties:
                      data:
                        - id: '639'
                          type: product_property
                        - id: '640'
                          type: product_property
                        - id: '641'
                          type: product_property
                        - id: '642'
                          type: product_property
                        - id: '643'
                          type: product_property
                        - id: '644'
                          type: product_property
                        - id: '645'
                          type: product_property
                        - id: '646'
                          type: product_property
                    taxons:
                      data:
                        - id: '19'
                          type: taxon
                        - id: '14'
                          type: taxon
                        - id: '24'
                          type: taxon
                        - id: '3'
                          type: taxon
                    images:
                      data: []
                    default_variant:
                      data:
                        id: '212'
                        type: variant
                    primary_variant:
                      data:
                        id: '96'
                        type: variant
                included:
                  - id: '212'
                    type: variant
                    attributes:
                      sku: JacketsandCoats_bomberjacket_38.99_khaki_xs
                      weight: '0.0'
                      height: null
                      width: null
                      depth: null
                      is_master: false
                      options_text: 'Color: khaki, Size: XS'
                      options:
                        - name: color
                          value: khaki
                          presentation: Khaki
                        - name: size
                          value: XS
                          presentation: XS
                      purchasable: true
                      in_stock: true
                      backorderable: false
                      currency: USD
                      price: '38.99'
                      display_price: $38.99
                      compare_at_price: null
                      display_compare_at_price: null
                    relationships:
                      product:
                        data:
                          id: '96'
                          type: product
                      images:
                        data: []
                      option_values:
                        data:
                          - id: '14'
                            type: option_value
                          - id: '23'
                            type: option_value
                  - id: '19'
                    type: taxon
                    attributes:
                      name: Bestsellers
                      pretty_name: Categories -> Bestsellers
                      permalink: categories/bestsellers
                      seo_title: Bestsellers
                      description: null
                      meta_title: null
                      meta_description: null
                      meta_keywords: null
                      left: 36
                      right: 37
                      position: 0
                      depth: 1
                      updated_at: '2021-10-02T11:03:15.082Z'
                      is_root: false
                      is_child: true
                      is_leaf: true
                    relationships:
                      parent:
                        data:
                          id: '1'
                          type: taxon
                      taxonomy:
                        data:
                          id: '1'
                          type: taxonomy
                      children:
                        data: []
                      image:
                        data: null
                  - id: '14'
                    type: taxon
                    attributes:
                      name: Jackets and Coats
                      pretty_name: Categories -> Women -> Jackets and Coats
                      permalink: categories/women/jackets-and-coats
                      seo_title: Jackets and Coats
                      description: null
                      meta_title: null
                      meta_description: null
                      meta_keywords: null
                      left: 23
                      right: 24
                      position: 0
                      depth: 2
                      updated_at: '2021-10-02T11:03:14.688Z'
                      is_root: false
                      is_child: true
                      is_leaf: true
                    relationships:
                      parent:
                        data:
                          id: '3'
                          type: taxon
                      taxonomy:
                        data:
                          id: '1'
                          type: taxonomy
                      children:
                        data: []
                      image:
                        data: null
                  - id: '24'
                    type: taxon
                    attributes:
                      name: Summer 2021
                      pretty_name: Categories -> New Collection -> Summer 2021
                      permalink: categories/new-collection/summer-2021
                      seo_title: Summer 2021
                      description: null
                      meta_title: null
                      meta_description: null
                      meta_keywords: null
                      left: 45
                      right: 46
                      position: 0
                      depth: 2
                      updated_at: '2021-10-02T11:03:15.001Z'
                      is_root: false
                      is_child: true
                      is_leaf: true
                    relationships:
                      parent:
                        data:
                          id: '23'
                          type: taxon
                      taxonomy:
                        data:
                          id: '1'
                          type: taxonomy
                      children:
                        data: []
                      image:
                        data: null
                  - id: '3'
                    type: taxon
                    attributes:
                      name: Women
                      pretty_name: Categories -> Women
                      permalink: categories/women
                      seo_title: Women
                      description: null
                      meta_title: null
                      meta_description: null
                      meta_keywords: null
                      left: 12
                      right: 25
                      position: 0
                      depth: 1
                      updated_at: '2021-10-02T11:03:14.688Z'
                      is_root: false
                      is_child: true
                      is_leaf: false
                    relationships:
                      parent:
                        data:
                          id: '1'
                          type: taxon
                      taxonomy:
                        data:
                          id: '1'
                          type: taxonomy
                      children:
                        data:
                          - id: '9'
                            type: taxon
                          - id: '10'
                            type: taxon
                          - id: '11'
                            type: taxon
                          - id: '12'
                            type: taxon
                          - id: '13'
                            type: taxon
                          - id: '14'
                            type: taxon
                      image:
                        data: null
    404NotFound:
      description: 404 Not Found - Resource not found.
      content:
        application/vnd.api+json:
          schema:
            properties:
              error:
                type: string
                example: The resource you were looking for could not be found.
                default: The resource you were looking for could not be found.
          examples:
            404 Example:
              value:
                error: The resource you were looking for could not be found.
  schemas:
    Product:
      type: object
      title: Product
      x-internal: false
      properties:
        id:
          type: string
          example: '1'
        type:
          type: string
          default: product
        attributes:
          type: object
          properties:
            name:
              type: string
              example: Example product
            description:
              type: string
              example: Example description
              nullable: true
            available_on:
              type: string
              example: '2012-10-17T03:43:57Z'
              nullable: true
            slug:
              type: string
              example: example-product
            price:
              type: string
              example: '15.99'
              nullable: true
            currency:
              type: string
              example: USD
            display_price:
              type: string
              example: $15.99
              nullable: true
            purchasable:
              type: boolean
              description: Indicates if any of Variants are in stock or backorderable
            in_stock:
              type: boolean
              description: Indicates if any of Variants are in stock
            backorderable:
              type: boolean
              description: Indicates if any of Variants are backeorderable
            meta_description:
              type: string
              example: Example product
              nullable: true
            meta_keywords:
              type: string
              example: example, product
              nullable: true
            updated_at:
              $ref: '#/components/schemas/Timestamp'
            sku:
              type: string
              example: 9238-WS
            available:
              type: boolean
            compare_at_price:
              type: string
              example: '49.99'
              nullable: true
            display_compare_at_price:
              type: string
              example: $49.99
              nullable: true
            localized_slugs:
              type: object
              description: Provides product's slugs in other locales
            tags:
              type: array
              items:
                type: string
              description: List of tags associated with the product
            labels:
              type: array
              items:
                type: string
              description: List of labels associated with the product
        relationships:
          type: object
          properties:
            variants:
              type: object
              description: List of Product Variants, excluding Master Variant
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/Relation'
            option_types:
              type: object
              description: List of Product Option Types
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/Relation'
            product_properties:
              type: object
              description: List of Product Properties
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/Relation'
            taxons:
              type: object
              description: List of Taxons associated with this Product
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/Relation'
            images:
              type: object
              description: List of Images associated with this Product
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/Relation'
            default_variant:
              type: object
              description: The default Variant for this product
              properties:
                data:
                  $ref: '#/components/schemas/Relation'
            primary_variant:
              type: object
              description: The Primary Variant for this product
              properties:
                data:
                  $ref: '#/components/schemas/Relation'
      required:
        - id
        - type
        - attributes
        - relationships
    ProductIncludes:
      x-internal: false
      title: Product Includes
      anyOf:
        - $ref: '#/components/schemas/OptionType'
        - $ref: '#/components/schemas/ProductProperty'
        - $ref: '#/components/schemas/Variant'
        - $ref: '#/components/schemas/Image'
        - $ref: '#/components/schemas/Taxon'
    Timestamp:
      type: string
      format: date-time
      example: '2020-02-16T07:14:54.617Z'
      x-internal: false
      title: Time Stamp
      x-examples:
        example-1: '2020-02-16T07:14:54.617Z'
    Relation:
      type: object
      nullable: true
      properties:
        id:
          type: string
        type:
          type: string
      required:
        - id
        - type
      x-internal: false
      description: ''
    OptionType:
      title: Option Type
      type: object
      x-internal: false
      properties:
        id:
          type: string
          example: '1'
        type:
          type: string
          default: option_type
        attributes:
          type: object
          properties:
            name:
              type: string
              example: color
            presentation:
              type: string
              example: Color
            position:
              type: integer
              example: 1
      required:
        - id
        - type
        - attributes
    ProductProperty:
      title: Product Property
      type: object
      properties:
        id:
          type: string
          example: '1'
        type:
          type: string
          default: product_property
        attributes:
          type: object
          properties:
            value:
              type: string
              example: Wilson
            filter_param:
              type: string
              example: wilson
            name:
              type: string
              example: manufacturer
            description:
              type: string
              example: Manufacturer
      required:
        - id
        - type
        - attributes
      x-internal: false
    Variant:
      title: Variant
      description: >-
        Variant records track the individual variants of a Product. Variants are
        of two types: master variants and normal variants.
      x-examples: {}
      type: object
      x-internal: false
      properties:
        id:
          type: string
          example: '1'
        type:
          type: string
          default: variant
        attributes:
          type: object
          properties:
            sku:
              type: string
              example: SKU-1001
            price:
              type: string
              example: '15.99'
            currency:
              type: string
              example: USD
            display_price:
              type: string
              example: $15.99
            weight:
              type: string
              example: '10'
              nullable: true
            height:
              type: string
              example: '10'
              nullable: true
            width:
              type: string
              example: '10'
              nullable: true
            depth:
              type: string
              example: '10'
              nullable: true
            is_master:
              type: boolean
              description: Indicates if Variant is the master Variant
            options_text:
              type: string
              example: 'Size: small, Color: red'
            options:
              type: array
              items:
                type: object
                properties:
                  name:
                    type: string
                  value:
                    type: string
                  presentation:
                    type: string
            purchasable:
              type: boolean
              description: Indicates if Variant is in stock or backorderable
            in_stock:
              type: boolean
              description: Indicates if Variant is in stock
            backorderable:
              type: boolean
        relationships:
          type: object
          properties:
            product:
              type: object
              properties:
                data:
                  $ref: '#/components/schemas/Relation'
            images:
              type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/Relation'
            option_values:
              type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/Relation'
      required:
        - id
        - type
        - attributes
        - relationships
    Image:
      type: object
      properties:
        id:
          type: string
          example: '1'
        type:
          type: string
          default: image
        attributes:
          type: object
          properties:
            position:
              type: integer
              description: Sort order of images set in the Admin Panel
              example: 0
              minimum: 0
            styles:
              type: array
              description: An array of pre-scaled image styles
              items:
                $ref: '#/components/schemas/ImageStyle'
      required:
        - id
        - type
        - attributes
      title: Image
      x-internal: false
    Taxon:
      title: Taxon
      type: object
      x-internal: false
      properties:
        id:
          type: string
          example: '1'
        type:
          type: string
          default: taxon
        attributes:
          type: object
          properties:
            name:
              type: string
              example: T-shirts
            pretty_name:
              type: string
              example: Clothes > T-shirts
            permalink:
              type: string
              example: t-shirts
            seo_title:
              type: string
              example: Clothes - T-shirts
            meta_title:
              type: string
              example: T-shirts
              nullable: true
            meta_description:
              type: string
              example: 'A list of cool t-shirts '
              nullable: true
            meta_keywords:
              type: string
              example: t-shirts, cool
              nullable: true
            left:
              type: integer
              example: 1
            right:
              type: integer
              example: 2
            position:
              type: integer
              example: 0
            depth:
              type: integer
              example: 1
              nullable: true
            is_root:
              type: boolean
              example: true
              description: Indicates if the Taxon is the root node of this Taxonomy tree
            is_child:
              type: boolean
              example: true
              description: Returns true is this is a child node of this Taxonomy tree
            is_leaf:
              type: boolean
              example: false
              description: >-
                Returns true if this is the end of a branch of this Taxonomy
                tree
            updated_at:
              type: string
              example: '2018-06-18T10:57:29.704Z'
            localized_slugs:
              type: object
              description: Provides taxon's slugs in other locales
        relationships:
          type: object
          properties:
            parent:
              type: object
              description: Parent node
              properties:
                data:
                  $ref: '#/components/schemas/Relation'
            children:
              type: object
              description: List of child nodes
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/Relation'
            taxonomy:
              type: object
              description: Taxonomy associated with this Taxon
              properties:
                data:
                  $ref: '#/components/schemas/Relation'
            image:
              type: object
              description: Image associated with Taxon
              properties:
                data:
                  $ref: '#/components/schemas/Relation'
            products:
              type: object
              description: List of active and available Products associated with this Taxon
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/Relation'
      required:
        - id
        - type
        - attributes
        - relationships
    ImageStyle:
      x-internal: false
      title: Image Style
      type: object
      properties:
        url:
          type: string
          example: >-
            http://localhost:3000/rails/active_storage/disk/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaEpJbWQyWVhKcFlXNTBjeTltWm1sMmRURlNORFpZWjJaSFpYUkdZMjk2WWsxM1RHWXZNVGs1T1RCak5XVmlNamN4TlRnd1pqVTBabUpqTWpCbFkyVXhZMlZpTTJFd05ERTJZemMzT0dKaE5tSTFNREkyT0dKaFpqa3paV1JtWTJWaE16aGxaQVk2QmtWVSIsImV4cCI6IjIwMTgtMDYtMjRUMTM6NTk6NTguOTY5WiIsInB1ciI6ImJsb2Jfa2V5In19--5e9ff358dc747f73754e332678c5762114ac6f3f/ror_jr_spaghetti.jpeg?content_type=image%2Fjpeg&disposition=inline%3B+filename%3D%22ror_jr_spaghetti.jpeg%22%3B+filename%2A%3DUTF-8%27%27ror_jr_spaghetti.jpeg
          description: Absolute URL of the uploaded image in selected style (width/height)
        width:
          type: integer
          example: 1920
          description: Actual width of image
        height:
          type: integer
          example: 1080
          description: Actual height of image

````