# Product variations

You can retrieve [product variations](https://app.gitbook.com/s/oUderMtztdH7OKDXmYbI/commerce-api-reference-guide/admin-apis-reference/products#product-variations) programmatically.

Offering customers various options to suit their preferences and needs is crucial when selling products online. Product variations allow you to provide multiple product versions, differing in attributes such as size, color, or style. By accessing product variations programmatically through the API, you can streamline the management and display of these options, enhancing the shopping experience.

## Getting product variations

To get product variations, you can send a [`GET /v1/shoppers/me/products/{productId}/variations`](https://app.gitbook.com/s/X2fWaY1Kp5sXA1fmOL7z/browse-product-discovery/product-variations#v1-shoppers-me-products-productid-variations) request, providing the `productId` for the desired product. Replace `{Your_Access_Token}` with your [access token](https://docs.digitalriver.com/commerce-api/shopper-apis/oauth/access-tokens). This request retrieves all variations for the specified product. Here's an example using cURL:

{% tabs %}
{% tab title="cURL" %}

```http
curl --location --request GET 'https://api.digitalriver.com/v1/shoppers/me/products/{productId}/variations \
--header 'authorization: bearer {Your_Access_token}\
...
```

{% endtab %}

{% tab title="200 OK response" %}

```json
{
  "variations": {
    "uri": "https://api.digitalriver.com/v1/shoppers/me/products/64358200/variations",
    "product": [
      {
        "uri": "https://api.digitalriver.com/v1/shoppers/me/products/64578500",
        "displayName": "Class I",
        "thumbnailImage": "https://drh-sys-ora.img.digitalriver.com/Storefront/Company/demosft1/images/product/thumbnail/classIThumb.jpg",
        "pricing": {
          "uri": "https://api.digitalriver.com/v1/shoppers/me/products/64578500/pricing",
          "formattedListPrice": "$19.99",
          "formattedSalePriceWithQuantity": "$17.99"
        },
        "addProductToCart": {
          "uri": "https://api.digitalriver.com/v1/shoppers/me/carts/active/line-items?productId=64578500",
          "cartUri": "https://api.digitalriver.com/v1/shoppers/me/carts/active?productId=64578500"
        }
      }
    ]
  }
}
```

{% endtab %}
{% endtabs %}

A `200 OK` response provides details of the product variations, including pricing and options for adding the product to the cart.
