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

# Get a Product

> Returns a single product.



## OpenAPI

````yaml api-reference/v1/openapi-products-v1.yaml get /products/{id}
openapi: 3.0.3
info:
  title: CoCart - Products API v1
  version: 4.6.0
  description: >-
    API for managing WooCommerce products, variations, categories, tags,
    attributes, and reviews
  termsOfService: http://cocartapi.com/terms-of-conditions-polar/
  contact:
    email: support@cocartapi.com
  license:
    name: GNU General Public License v3.0
    url: http://www.gnu.org/licenses/gpl-3.0.html
servers:
  - url: '{protocol}://{host}/wp-json/cocart/v1'
    description: API v1
    variables:
      protocol:
        enum:
          - http
          - https
        default: https
      host:
        default: example-store.com
        description: Your store domain
security: []
tags:
  - name: products
    description: Operations for managing products
  - name: product-variations
    description: Operations for managing product variations
  - name: product-categories
    description: Operations for managing product categories
  - name: product-tags
    description: Operations for managing product tags
  - name: product-attributes
    description: Operations for managing product attributes
  - name: product-attribute-terms
    description: Operations for managing product attribute terms
  - name: product-reviews
    description: Operations for managing product reviews
externalDocs:
  description: Find out more about CoCart API
  url: https://docs.cocartapi.com
paths:
  /products/{id}:
    get:
      tags:
        - products
      summary: Get a product
      description: Returns a single product.
      parameters:
        - name: id
          in: path
          description: Unique identifier for the product.
          required: true
          schema:
            type: integer
        - name: context
          in: query
          description: >-
            Scope under which the request is made; determines fields present in
            response.
          schema:
            type: string
            enum:
              - view
              - embed
            default: view
          required: false
      responses:
        '200':
          description: Product data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Product'
        '404':
          description: Product not found.
components:
  schemas:
    Product:
      type: object
      properties:
        id:
          type: integer
          description: Unique identifier for the product.
        name:
          type: string
          description: Product name.
        slug:
          type: string
          description: Product slug.
        permalink:
          type: string
          description: Product URL.
        date_created:
          type: string
          format: date-time
          description: Date when the product was created.
        date_created_gmt:
          type: string
          format: date-time
          description: Date when the product was created in GMT.
        date_modified:
          type: string
          format: date-time
          description: Date when the product was last modified.
        date_modified_gmt:
          type: string
          format: date-time
          description: Date when the product was last modified in GMT.
        type:
          type: string
          description: Product type.
        status:
          type: string
          description: Product status.
        featured:
          type: boolean
          description: Whether the product is featured.
        catalog_visibility:
          type: string
          description: Product catalog visibility.
        description:
          type: string
          description: Product description.
        short_description:
          type: string
          description: Product short description.
        sku:
          type: string
          description: Product SKU.
        price:
          type: string
          description: Product price.
        regular_price:
          type: string
          description: Product regular price.
        sale_price:
          type: string
          description: Product sale price.
        date_on_sale_from:
          type: string
          format: date-time
          description: Date when the sale price starts.
        date_on_sale_from_gmt:
          type: string
          format: date-time
          description: Date when the sale price starts in GMT.
        date_on_sale_to:
          type: string
          format: date-time
          description: Date when the sale price ends.
        date_on_sale_to_gmt:
          type: string
          format: date-time
          description: Date when the sale price ends in GMT.
        price_html:
          type: string
          description: Product price HTML.
        on_sale:
          type: boolean
          description: Whether the product is on sale.
        purchasable:
          type: boolean
          description: Whether the product is purchasable.
        total_sales:
          type: integer
          description: Total number of sales.
        virtual:
          type: boolean
          description: Whether the product is virtual.
        downloadable:
          type: boolean
          description: Whether the product is downloadable.
        downloads:
          type: array
          items:
            type: object
            properties:
              id:
                type: string
                description: Unique identifier for the download.
              name:
                type: string
                description: Download name.
              file:
                type: string
                description: Download file URL.
        download_limit:
          type: integer
          description: Download limit.
        download_expiry:
          type: integer
          description: Download expiry.
        external_url:
          type: string
          description: External URL.
        button_text:
          type: string
          description: Button text.
        tax_status:
          type: string
          description: Tax status.
        tax_class:
          type: string
          description: Tax class.
        manage_stock:
          type: boolean
          description: Whether stock management is enabled.
        stock_quantity:
          type: integer
          description: Stock quantity.
        stock_status:
          type: string
          description: Stock status.
        backorders:
          type: string
          description: Backorders status.
        backorders_allowed:
          type: boolean
          description: Whether backorders are allowed.
        backordered:
          type: boolean
          description: Whether the product is backordered.
        sold_individually:
          type: boolean
          description: Whether the product is sold individually.
        weight:
          type: string
          description: Product weight.
        dimensions:
          type: object
          properties:
            length:
              type: string
              description: Product length.
            width:
              type: string
              description: Product width.
            height:
              type: string
              description: Product height.
        shipping_required:
          type: boolean
          description: Whether shipping is required.
        shipping_taxable:
          type: boolean
          description: Whether shipping is taxable.
        shipping_class:
          type: string
          description: Shipping class.
        shipping_class_id:
          type: integer
          description: Shipping class ID.
        reviews_allowed:
          type: boolean
          description: Whether reviews are allowed.
        average_rating:
          type: string
          description: Average rating.
        rating_count:
          type: integer
          description: Rating count.
        related_ids:
          type: array
          items:
            type: integer
          description: Related product IDs.
        upsell_ids:
          type: array
          items:
            type: integer
          description: Upsell product IDs.
        cross_sell_ids:
          type: array
          items:
            type: integer
          description: Cross-sell product IDs.
        parent_id:
          type: integer
          description: Parent product ID.
        purchase_note:
          type: string
          description: Purchase note.
        categories:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                description: Category ID.
              name:
                type: string
                description: Category name.
              slug:
                type: string
                description: Category slug.
        tags:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                description: Tag ID.
              name:
                type: string
                description: Tag name.
              slug:
                type: string
                description: Tag slug.
        images:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                description: Image ID.
              src:
                type: string
                description: Image URL.
              name:
                type: string
                description: Image name.
              alt:
                type: string
                description: Image alt text.
        attributes:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                description: Attribute ID.
              name:
                type: string
                description: Attribute name.
              position:
                type: integer
                description: Attribute position.
              visible:
                type: boolean
                description: Whether the attribute is visible.
              variation:
                type: boolean
                description: Whether the attribute is a variation.
              options:
                type: array
                items:
                  type: string
                description: Attribute options.
        default_attributes:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                description: Attribute ID.
              name:
                type: string
                description: Attribute name.
              option:
                type: string
                description: Attribute option.
        variations:
          type: array
          items:
            type: integer
          description: Variation IDs.
        grouped_products:
          type: array
          items:
            type: integer
          description: Grouped product IDs.
        menu_order:
          type: integer
          description: Menu order.
        meta_data:
          type: array
          items:
            type: object
            properties:
              id:
                type: integer
                description: Meta data ID.
              key:
                type: string
                description: Meta data key.
              value:
                type: string
                description: Meta data value.
        links:
          type: object
          properties:
            self:
              type: array
              items:
                type: object
                properties:
                  href:
                    type: string
                    description: Link URL.
            collection:
              type: array
              items:
                type: object
                properties:
                  href:
                    type: string
                    description: Link URL.

````