# Get product variants associated with a selling plan

## Get product variants associated with a selling plan

> Retrieve product variants associated with a selling plan, including their preorder details and sales metrics.\
> \
> Filtering behavior:\
> \- No parameters: Returns all product variants in the selling plan\
> \- shopify\_product\_id: Returns all variants for that specific product\
> \- shopify\_variant\_id: Returns only that specific variant (single object response)<br>

```json
{"openapi":"3.0.3","info":{"title":"Preorders API","version":"1.0.0"},"servers":[{"url":"https://app.stoqapp.com/api/v1/external","description":"Production server"}],"security":[{"ApiKeyAuth":[]}],"components":{"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-Auth-Token"}},"schemas":{"SellingPlanProductVariantsResponse":{"type":"object","properties":{"selling_plan_id":{"type":"string","description":"ID of the selling plan"},"selling_plan_name":{"type":"string","description":"Name of the selling plan"},"currency":{"type":"string","description":"Shop currency code"},"product_variants":{"type":"array","items":{"$ref":"#/components/schemas/ProductVariantDetails"},"description":"List of product variants associated with this selling plan"},"meta":{"type":"object","properties":{"total_variants":{"type":"integer","description":"Total number of variants in results"},"total_units_sold":{"type":"integer","description":"Total units sold across all variants"}}}}},"ProductVariantDetails":{"type":"object","properties":{"shopify_product_id":{"type":"integer","description":"Shopify product ID"},"shopify_variant_id":{"type":"integer","description":"Shopify variant ID"},"product_title":{"type":"string","description":"Product title"},"variant_title":{"type":"string","description":"Variant title (null for single-variant products)"},"preorder_units_sold":{"type":"integer","description":"Total units sold through preorders for this variant"},"preorder_max_count":{"type":"integer","nullable":true,"description":"Maximum number of preorders allowed for this variant"},"shipping_text":{"type":"string","nullable":true,"description":"Custom shipping text configured for this variant in the selling plan"}}},"SellingPlanSingleVariantResponse":{"type":"object","properties":{"selling_plan_id":{"type":"string","description":"ID of the selling plan"},"selling_plan_name":{"type":"string","description":"Name of the selling plan"},"currency":{"type":"string","description":"Shop currency code"},"product_variant":{"$ref":"#/components/schemas/ProductVariantDetails"},"meta":{"type":"object","properties":{"total_units_sold":{"type":"integer","description":"Units sold for this variant"}}}}}}},"paths":{"/preorders/{id}/product_variants":{"get":{"summary":"Get product variants associated with a selling plan","description":"Retrieve product variants associated with a selling plan, including their preorder details and sales metrics.\n\nFiltering behavior:\n- No parameters: Returns all product variants in the selling plan\n- shopify_product_id: Returns all variants for that specific product\n- shopify_variant_id: Returns only that specific variant (single object response)\n","tags":["Preorders"],"parameters":[{"in":"header","name":"X-Auth-Token","required":true,"schema":{"type":"string"},"description":"API key for authentication"},{"in":"path","name":"id","required":true,"schema":{"type":"string"},"description":"Selling plan ID"},{"in":"query","name":"shopify_product_id","schema":{"type":"integer"},"description":"Filter by specific Shopify product ID to get all variants for that product"},{"in":"query","name":"shopify_variant_id","schema":{"type":"integer"},"description":"Filter by specific Shopify variant ID to get only that variant (returns single object)"}],"responses":{"200":{"description":"Product variants with their preorder details and sales metrics","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/SellingPlanProductVariantsResponse"},{"$ref":"#/components/schemas/SellingPlanSingleVariantResponse"}]}}}},"400":{"description":"Bad request - cannot filter by both product and variant ID","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Unauthorized"},"404":{"description":"Selling plan not found or variant not found in this selling plan","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}}}}}}}
```
