Get product variants associated with a selling plan
LegacyAPI v1 is the older API. It still works and is supported, but new integrations should use API v2. Migrating from v1 to v2
const url = 'https://app.stoqapp.com/api/v1/external/preorders/example/product_variants';const options = {method: 'GET', headers: {'X-Auth-Token': '<X-Auth-Token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://app.stoqapp.com/api/v1/external/preorders/example/product_variants \ --header 'X-Auth-Token: <X-Auth-Token>'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)
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Selling plan ID
Header Parameters
Section titled “Header Parameters”API key for authentication
Query Parameters
Section titled “Query Parameters”Filter by specific Shopify product ID to get all variants for that product
Filter by specific Shopify variant ID to get only that variant (returns single object)
Responses
Section titled “Responses”Product variants with their preorder details and sales metrics
object
ID of the selling plan
Name of the selling plan
Shop currency code
List of product variants associated with this selling plan
object
Shopify product ID
Shopify variant ID
Product title
Variant title (null for single-variant products)
Total units sold through preorders for this variant
Maximum number of preorders allowed for this variant
Custom shipping text configured for this variant in the selling plan
object
Total number of variants in results
Total units sold across all variants
object
ID of the selling plan
Name of the selling plan
Shop currency code
object
Shopify product ID
Shopify variant ID
Product title
Variant title (null for single-variant products)
Total units sold through preorders for this variant
Maximum number of preorders allowed for this variant
Custom shipping text configured for this variant in the selling plan
object
Units sold for this variant
Example
{ "selling_plan_id": "79b44c6c-ebc7-41d4-8a1b-573d7c693454", "selling_plan_name": "Summer Preorder", "currency": "USD", "product_variants": [ { "shopify_product_id": 7891234567890, "shopify_variant_id": 43900910010503, "product_title": "Classic T-Shirt", "variant_title": "Medium / Red", "preorder_units_sold": 18, "preorder_max_count": 100, "shipping_text": "Ships July 2026" } ], "meta": { "total_variants": 12, "total_units_sold": 140 }}Bad request - cannot filter by both product and variant ID
object
Example generated
{ "error": "example"}Unauthorized
Selling plan not found or variant not found in this selling plan
object
Example generated
{ "error": "example"}Thanks for letting us know.
Still stuck? Ask Quinn or chat with support