> ## 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 Variation

> Returns a single product variation.



## OpenAPI

````yaml api-reference/v1/openapi-products-v1.yaml get /products/{product_id}/variations/{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/{product_id}/variations/{id}:
    get:
      tags:
        - product-variations
      summary: Get a product variation
      description: Returns a single product variation.
      parameters:
        - name: product_id
          in: path
          description: Unique identifier for the variable product.
          required: true
          schema:
            type: integer
        - name: id
          in: path
          description: Unique identifier for the variation.
          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 variation data.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProductVariation'
        '404':
          description: Product variation not found.
components:
  schemas:
    ProductVariation:
      type: object
      properties:
        id:
          type: integer
          description: Unique identifier for the variation.
        date_created:
          type: string
          format: date-time
          description: Date when the variation was created.
        date_created_gmt:
          type: string
          format: date-time
          description: Date when the variation was created in GMT.
        date_modified:
          type: string
          format: date-time
          description: Date when the variation was last modified.
        date_modified_gmt:
          type: string
          format: date-time
          description: Date when the variation was last modified in GMT.
        description:
          type: string
          description: Variation description.
        permalink:
          type: string
          description: Variation URL.
        sku:
          type: string
          description: Variation SKU.
        price:
          type: string
          description: Variation price.
        regular_price:
          type: string
          description: Variation regular price.
        sale_price:
          type: string
          description: Variation 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.
        on_sale:
          type: boolean
          description: Whether the variation is on sale.
        status:
          type: string
          description: Variation status.
        purchasable:
          type: boolean
          description: Whether the variation is purchasable.
        virtual:
          type: boolean
          description: Whether the variation is virtual.
        downloadable:
          type: boolean
          description: Whether the variation 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.
        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 variation is backordered.
        weight:
          type: string
          description: Variation weight.
        dimensions:
          type: object
          properties:
            length:
              type: string
              description: Variation length.
            width:
              type: string
              description: Variation width.
            height:
              type: string
              description: Variation height.
        shipping_class:
          type: string
          description: Shipping class.
        shipping_class_id:
          type: integer
          description: Shipping class ID.
        image:
          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.
              option:
                type: string
                description: Attribute option.
        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.
            up:
              type: array
              items:
                type: object
                properties:
                  href:
                    type: string
                    description: Link URL.

````