> ## 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 Product Variations

> Returns a list of product variations.



## OpenAPI

````yaml api-reference/v1/openapi-products-v1.yaml get /products/{product_id}/variations
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:
    get:
      tags:
        - product-variations
      summary: Get product variations
      description: Returns a list of product variations.
      parameters:
        - name: product_id
          in: path
          description: Unique identifier for the variable 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
        - name: page
          in: query
          description: Current page of the collection.
          schema:
            type: integer
            default: 1
          required: false
        - name: per_page
          in: query
          description: Maximum number of items to be returned in result set.
          schema:
            type: integer
            default: 10
            maximum: 100
          required: false
        - name: search
          in: query
          description: Limit results to those matching a string.
          schema:
            type: string
          required: false
        - name: after
          in: query
          description: >-
            Limit response to resources published after a given ISO8601
            compliant date.
          schema:
            type: string
            format: date-time
          required: false
        - name: before
          in: query
          description: >-
            Limit response to resources published before a given ISO8601
            compliant date.
          schema:
            type: string
            format: date-time
          required: false
        - name: modified_after
          in: query
          description: >-
            Limit response to resources modified after a given ISO8601 compliant
            date.
          schema:
            type: string
            format: date-time
          required: false
        - name: modified_before
          in: query
          description: >-
            Limit response to resources modified before a given ISO8601
            compliant date.
          schema:
            type: string
            format: date-time
          required: false
        - name: dates_are_gmt
          in: query
          description: >-
            Whether to consider GMT post dates when limiting response by
            published or modified date.
          schema:
            type: boolean
            default: false
          required: false
        - name: exclude
          in: query
          description: Ensure result set excludes specific IDs.
          schema:
            type: array
            items:
              type: integer
          required: false
        - name: include
          in: query
          description: Limit result set to specific IDs.
          schema:
            type: array
            items:
              type: integer
          required: false
        - name: offset
          in: query
          description: Offset the result set by a specific number of items.
          schema:
            type: integer
          required: false
        - name: order
          in: query
          description: Order sort attribute ascending or descending.
          schema:
            type: string
            enum:
              - asc
              - desc
            default: desc
          required: false
        - name: orderby
          in: query
          description: Sort collection by object attribute.
          schema:
            type: string
            enum:
              - date
              - id
              - include
              - title
              - slug
              - price
              - popularity
              - rating
              - menu_order
            default: date
          required: false
        - name: parent
          in: query
          description: Limit result set to those of particular parent IDs.
          schema:
            type: array
            items:
              type: integer
          required: false
        - name: parent_exclude
          in: query
          description: >-
            Limit result set to all items except those of a particular parent
            ID.
          schema:
            type: array
            items:
              type: integer
          required: false
        - name: slug
          in: query
          description: Limit result set to products with a specific slug.
          schema:
            type: string
          required: false
        - name: status
          in: query
          description: Limit result set to products assigned a specific status.
          schema:
            type: string
            enum:
              - draft
              - pending
              - private
              - publish
            default: publish
          required: false
        - name: sku
          in: query
          description: Limit result set to products with a specific SKU.
          schema:
            type: string
          required: false
        - name: featured
          in: query
          description: Limit result set to featured products.
          schema:
            type: boolean
          required: false
        - name: on_sale
          in: query
          description: Limit result set to products on sale.
          schema:
            type: boolean
          required: false
        - name: min_price
          in: query
          description: Limit result set to products based on a minimum price.
          schema:
            type: string
          required: false
        - name: max_price
          in: query
          description: Limit result set to products based on a maximum price.
          schema:
            type: string
          required: false
        - name: stock_status
          in: query
          description: Limit result set to products with specified stock status.
          schema:
            type: string
            enum:
              - instock
              - outofstock
              - onbackorder
          required: false
      responses:
        '200':
          description: List of product variations.
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/ProductVariation'
        '404':
          description: Product 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.

````