List variants of a Shopify product
API v2 is in public beta: endpoints and fields can change before general availability.
/products/{shopify_product_id}/variantsCosts 1 rate-limit point · Rate limits
List a Shopify product's variants, read from Shopify, with what Filemonk delivers to a buyer of each: delivers_from is variant (the variant's own digital product), product (the one for every variant of the product), variant_and_product (both: the buyer gets both sets of files) or none. files_count is how many files that buyer gets. Up to per_page variants (default 50, max 200) by title; pass next_cursor back as cursor for the rest.
Read-only; asks Shopify. shopify_product_id is a Shopify Product gid or numeric id, from GET /digital_products or GET /digital_products/shopify_products_without_files. digital_products on a row names each digital product that applies, with its id for GET /digital_products/:id. 404 when Shopify has no such product; 502 when Shopify did not answer.
Also searched asproduct variantsvariants of a productlist variantswhich variants have fileswhich variants deliver filesfiles per variantwhat does each variant delivervariants without files
Path parameters
shopify_product_idstringRequired
Query parameters
cursorstringper_pageintegerRows per page, max 200.
Default50
Returns
shopify_product_idstring, nullableExample:gid://shopify/Product/9642107044135product_titlestring, nullableExample:Watercolour Coursedataarray of objectsShow 7 child attributesHide child attributes
shopify_variant_idstring, nullableExample:gid://shopify/ProductVariant/49231577301031titlestring, nullableExample:Beginnernamestring, nullableExample:Watercolour Course — Beginnerskustring, nullableExample:WC-BEGdelivers_fromstring, nullableExample:variant_and_productfiles_countinteger, nullableExample:3digital_productsarray of objectsShow 3 child attributesHide child attributes
idstring, nullableExample:3f1c2a9e-7b4d-4c1e-9a8f-2d6b5e4c3a21scopestring, nullableExample:variantfiles_countinteger, nullableExample:1
total_countinteger, nullableExample:2next_cursoranyhas_next_pageboolean, nullableExample:false
Errors
The resource does not exist for this shop, or the action path is not registered.
The request failed validation, or sent a key the action does not take (code: "unknown_parameters" with unknown and accepted). Nothing was saved.
shopify_errorShopify (or the email service) did not complete the request. Nothing was changed; try again shortly.
Any request can also fail with rate_limited (429).
Every error has the same shape: see Errors.
curl "https://app.filemonk.io/api/v2/external/products/{shopify_product_id}/variants" \
-H "X-Auth-Token: $FILEMONK_API_KEY"const res = await fetch("https://app.filemonk.io/api/v2/external/products/{shopify_product_id}/variants", {
headers: {
"X-Auth-Token": process.env.FILEMONK_API_KEY,
},
});
const data = await res.json();import os
import requests
res = requests.get(
"https://app.filemonk.io/api/v2/external/products/{shopify_product_id}/variants",
headers={"X-Auth-Token": os.environ["FILEMONK_API_KEY"]},
)
data = res.json()require "net/http"
require "json"
uri = URI("https://app.filemonk.io/api/v2/external/products/{shopify_product_id}/variants")
req = Net::HTTP::Get.new(uri, "X-Auth-Token" => ENV["FILEMONK_API_KEY"])
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body){
"shopify_product_id": "gid://shopify/Product/9642107044135",
"product_title": "Watercolour Course",
"data": [
{
"shopify_variant_id": "gid://shopify/ProductVariant/49231577301031",
"title": "Beginner",
"name": "Watercolour Course — Beginner",
"sku": "WC-BEG",
"delivers_from": "variant_and_product",
"files_count": 3,
"digital_products": [
{
"id": "3f1c2a9e-7b4d-4c1e-9a8f-2d6b5e4c3a21",
"scope": "variant",
"files_count": 1
},
{
"id": "8a2b4c6d-1e3f-4a5b-8c7d-9e0f1a2b3c4d",
"scope": "product",
"files_count": 2
}
]
},
{
"shopify_variant_id": "gid://shopify/ProductVariant/49231577333799",
"title": "Advanced",
"name": "Watercolour Course — Advanced",
"sku": null,
"delivers_from": "product",
"files_count": 2,
"digital_products": [
{
"id": "8a2b4c6d-1e3f-4a5b-8c7d-9e0f1a2b3c4d",
"scope": "product",
"files_count": 2
}
]
}
],
"total_count": 2,
"next_cursor": null,
"has_next_page": false
}{
"errors": [
"Invalid API key"
]
}{
"errors": [
"Order not found: c3d4e5f6-7a8b-4c9d-8e0f-1a2b3c4d5e6f"
]
}{
"errors": [
"access.download_limit_count must be an integer of at least 0"
],
"field_errors": {
"access.download_limit_count": [
"must be an integer of at least 0"
]
}
}{
"errors": [
"You have exceeded the rate limit of 40 points per 60 seconds. Read requests cost 1 point(s) and write requests cost 2 point(s). Please retry after 12 second(s)."
],
"code": "rate_limited",
"retry_after": 12,
"error": "Rate limit exceeded",
"message": "You have exceeded the rate limit of 40 points per 60 seconds. Read requests cost 1 point(s) and write requests cost 2 point(s). Please retry after 12 second(s)."
}{
"errors": [
"Shopify did not complete the request. Nothing was changed; try again shortly."
],
"code": "shopify_error"
}