# Add product variants to a selling plan

## POST /preorders/{id}/add\_variant

> Add multiple product variants to a selling plan

```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"}}},"paths":{"/preorders/{id}/add_variant":{"post":{"summary":"Add multiple product variants to a selling plan","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"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"shopify_variant_ids":{"type":"array","items":{"type":"integer"},"description":"Array of Shopify variant IDs to add"}},"required":["shopify_variant_ids"]}}}},"responses":{"200":{"description":"Variants added successfully","content":{"application/json":{"schema":{"type":"object","properties":{"success":{"type":"boolean"},"message":{"type":"string"},"variants_added":{"type":"array","items":{"type":"integer"},"description":"List of variant IDs that were added"}}}}}},"400":{"description":"Bad request - missing or invalid shopify_variant_ids","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"}}}}}},"401":{"description":"Unauthorized"},"404":{"description":"Selling plan not found"},"422":{"description":"Some variants already added or other error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"string"},"existing_variants":{"type":"array","items":{"type":"integer"},"description":"List of variant IDs that were already added"}}}}}}}}}}}
```


---

# Agent Instructions: 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:

```
GET https://docs.stoqapp.com/preorders-api/add-product-variants-to-a-selling-plan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
