> For the complete documentation index, see [llms.txt](https://docs.stoqapp.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.stoqapp.com/preorders-api/get-product-variants-associated-with-a-selling-plan.md).

# 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"}}}}}}}}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.stoqapp.com/preorders-api/get-product-variants-associated-with-a-selling-plan.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
