import { createAdminClient } from '@spree/admin-sdk'
const client = createAdminClient({
baseUrl: 'https://your-store.com',
secretKey: 'sk_xxx',
})
const { data: variants } = await client.products.variants.list('prod_86Rf07xd4z', {
expand: ['prices', 'stock_levels'],
})spree api get /products/{product_id}/variants -d '{"expand":["prices","stock_levels"]}'{
"data": [
{
"id": "variant_UkLWZg9DAJ",
"product_id": "prod_UkLWZg9DAJ",
"sku": "SKU-285",
"options_text": "",
"track_inventory": true,
"media_count": 0,
"preorder_ships_at": null,
"thumbnail_url": null,
"purchasable": true,
"in_stock": false,
"backorderable": true,
"preorder": false,
"weight": 0,
"height": null,
"width": null,
"depth": null,
"weight_unit": "lb",
"dimensions_unit": "in",
"minimum_order_quantity": null,
"order_multiple": null,
"purchase_unit": null,
"units_per_carton": null,
"price": {
"id": "price_UkLWZg9DAJ",
"currency": "USD",
"amount": "19.99",
"compare_at_amount": null,
"price_list_id": null,
"min_quantity": 1,
"variant_id": "variant_UkLWZg9DAJ",
"created_at": "2026-01-15T12:00:00.000Z",
"updated_at": "2026-01-15T12:00:00.000Z"
},
"original_price": null,
"seller_id": null,
"option_values": [],
"external_references": {},
"metadata": {},
"position": 1,
"cost_currency": "USD",
"barcode": null,
"backorder_limit": null,
"hs_code": null,
"country_of_origin": null,
"customs_description": null,
"carton_weight": null,
"cartons_per_pallet": null,
"deleted_at": null,
"created_at": "2026-01-15T12:00:00.000Z",
"updated_at": "2026-01-15T12:00:00.000Z",
"cost_price": "17.00",
"preorderable": false,
"tax_category_id": null,
"carton_package_type_id": null,
"units_per_pallet": null,
"available_stock": 0,
"reserved_quantity": 0,
"total_on_hand": 0,
"product_name": "Product 2146804",
"delivery_profile_id": "fp_UkLWZg9DAJ"
},
{
"id": "variant_gbHJdmfrXB",
"product_id": "prod_UkLWZg9DAJ",
"sku": "SKU-286",
"options_text": "Size: S",
"track_inventory": true,
"media_count": 0,
"preorder_ships_at": null,
"thumbnail_url": null,
"purchasable": true,
"in_stock": false,
"backorderable": true,
"preorder": false,
"weight": 198.7,
"height": 97.29,
"width": 126.5,
"depth": 56.58,
"weight_unit": "lb",
"dimensions_unit": "in",
"minimum_order_quantity": null,
"order_multiple": null,
"purchase_unit": null,
"units_per_carton": null,
"price": {
"id": "price_gbHJdmfrXB",
"currency": "USD",
"amount": "19.99",
"compare_at_amount": null,
"price_list_id": null,
"min_quantity": 1,
"variant_id": "variant_gbHJdmfrXB",
"created_at": "2026-01-15T12:00:00.000Z",
"updated_at": "2026-01-15T12:00:00.000Z"
},
"original_price": null,
"seller_id": null,
"option_values": [
{
"id": "optval_UkLWZg9DAJ",
"option_type_id": "opt_UkLWZg9DAJ",
"name": "size-70",
"label": "S",
"position": 1,
"color_code": null,
"option_type_name": "foo-size-80",
"option_type_label": "Size",
"image_url": null,
"metadata": {},
"created_at": "2026-01-15T12:00:00.000Z",
"updated_at": "2026-01-15T12:00:00.000Z"
}
],
"external_references": {},
"metadata": {},
"position": 2,
"cost_currency": "USD",
"barcode": null,
"backorder_limit": null,
"hs_code": null,
"country_of_origin": null,
"customs_description": null,
"carton_weight": null,
"cartons_per_pallet": null,
"deleted_at": null,
"created_at": "2026-01-15T12:00:00.000Z",
"updated_at": "2026-01-15T12:00:00.000Z",
"cost_price": "17.00",
"preorderable": false,
"tax_category_id": null,
"carton_package_type_id": null,
"units_per_pallet": null,
"available_stock": 0,
"reserved_quantity": 0,
"total_on_hand": 0,
"product_name": "Product 2146804",
"delivery_profile_id": "fp_UkLWZg9DAJ"
}
],
"meta": {
"page": 1,
"limit": 25,
"count": 2,
"pages": 1,
"from": 1,
"to": 2,
"in": 2,
"previous": null,
"next": null
}
}List product variants
Returns a paginated list of variants for a product, including the default variant.
Required scope: read_products (for API-key authentication).
import { createAdminClient } from '@spree/admin-sdk'
const client = createAdminClient({
baseUrl: 'https://your-store.com',
secretKey: 'sk_xxx',
})
const { data: variants } = await client.products.variants.list('prod_86Rf07xd4z', {
expand: ['prices', 'stock_levels'],
})spree api get /products/{product_id}/variants -d '{"expand":["prices","stock_levels"]}'{
"data": [
{
"id": "variant_UkLWZg9DAJ",
"product_id": "prod_UkLWZg9DAJ",
"sku": "SKU-285",
"options_text": "",
"track_inventory": true,
"media_count": 0,
"preorder_ships_at": null,
"thumbnail_url": null,
"purchasable": true,
"in_stock": false,
"backorderable": true,
"preorder": false,
"weight": 0,
"height": null,
"width": null,
"depth": null,
"weight_unit": "lb",
"dimensions_unit": "in",
"minimum_order_quantity": null,
"order_multiple": null,
"purchase_unit": null,
"units_per_carton": null,
"price": {
"id": "price_UkLWZg9DAJ",
"currency": "USD",
"amount": "19.99",
"compare_at_amount": null,
"price_list_id": null,
"min_quantity": 1,
"variant_id": "variant_UkLWZg9DAJ",
"created_at": "2026-01-15T12:00:00.000Z",
"updated_at": "2026-01-15T12:00:00.000Z"
},
"original_price": null,
"seller_id": null,
"option_values": [],
"external_references": {},
"metadata": {},
"position": 1,
"cost_currency": "USD",
"barcode": null,
"backorder_limit": null,
"hs_code": null,
"country_of_origin": null,
"customs_description": null,
"carton_weight": null,
"cartons_per_pallet": null,
"deleted_at": null,
"created_at": "2026-01-15T12:00:00.000Z",
"updated_at": "2026-01-15T12:00:00.000Z",
"cost_price": "17.00",
"preorderable": false,
"tax_category_id": null,
"carton_package_type_id": null,
"units_per_pallet": null,
"available_stock": 0,
"reserved_quantity": 0,
"total_on_hand": 0,
"product_name": "Product 2146804",
"delivery_profile_id": "fp_UkLWZg9DAJ"
},
{
"id": "variant_gbHJdmfrXB",
"product_id": "prod_UkLWZg9DAJ",
"sku": "SKU-286",
"options_text": "Size: S",
"track_inventory": true,
"media_count": 0,
"preorder_ships_at": null,
"thumbnail_url": null,
"purchasable": true,
"in_stock": false,
"backorderable": true,
"preorder": false,
"weight": 198.7,
"height": 97.29,
"width": 126.5,
"depth": 56.58,
"weight_unit": "lb",
"dimensions_unit": "in",
"minimum_order_quantity": null,
"order_multiple": null,
"purchase_unit": null,
"units_per_carton": null,
"price": {
"id": "price_gbHJdmfrXB",
"currency": "USD",
"amount": "19.99",
"compare_at_amount": null,
"price_list_id": null,
"min_quantity": 1,
"variant_id": "variant_gbHJdmfrXB",
"created_at": "2026-01-15T12:00:00.000Z",
"updated_at": "2026-01-15T12:00:00.000Z"
},
"original_price": null,
"seller_id": null,
"option_values": [
{
"id": "optval_UkLWZg9DAJ",
"option_type_id": "opt_UkLWZg9DAJ",
"name": "size-70",
"label": "S",
"position": 1,
"color_code": null,
"option_type_name": "foo-size-80",
"option_type_label": "Size",
"image_url": null,
"metadata": {},
"created_at": "2026-01-15T12:00:00.000Z",
"updated_at": "2026-01-15T12:00:00.000Z"
}
],
"external_references": {},
"metadata": {},
"position": 2,
"cost_currency": "USD",
"barcode": null,
"backorder_limit": null,
"hs_code": null,
"country_of_origin": null,
"customs_description": null,
"carton_weight": null,
"cartons_per_pallet": null,
"deleted_at": null,
"created_at": "2026-01-15T12:00:00.000Z",
"updated_at": "2026-01-15T12:00:00.000Z",
"cost_price": "17.00",
"preorderable": false,
"tax_category_id": null,
"carton_package_type_id": null,
"units_per_pallet": null,
"available_stock": 0,
"reserved_quantity": 0,
"total_on_hand": 0,
"product_name": "Product 2146804",
"delivery_profile_id": "fp_UkLWZg9DAJ"
}
],
"meta": {
"page": 1,
"limit": 25,
"count": 2,
"pages": 1,
"from": 1,
"to": 2,
"in": 2,
"previous": null,
"next": null
}
}Filters
Filter withq[<attribute>_<predicate>]=value, for example q[hs_code_cont]=…. Send a list as q[<attribute>_in][]=a&q[<attribute>_in][]=b. How filters work.
| Attribute | Kind | Predicates |
|---|---|---|
carton_package_type_id | Prefixed ID | eq not_eq in not_in null not_null |
carton_weight | Amount | eq not_eq in not_in lt lteq gt gteq null not_null |
cartons_per_pallet | Number | eq not_eq in not_in lt lteq gt gteq null not_null |
cost_currency | One of the CurrencyCode codes | eq not_eq in not_in null not_null |
cost_price | Amount | eq not_eq in not_in lt lteq gt gteq null not_null |
country_of_origin | One of the CountryCode codes | eq not_eq in not_in null not_null |
created_at | Date and time | eq not_eq in not_in lt lteq gt gteq null not_null |
deleted_at | Date and time | eq not_eq in not_in lt lteq gt gteq null not_null |
depth | Amount | eq not_eq in not_in lt lteq gt gteq null not_null |
discontinue_on | Date and time | eq not_eq in not_in lt lteq gt gteq null not_null |
height | Amount | eq not_eq in not_in lt lteq gt gteq null not_null |
hs_code | Text | eq not_eq in not_in cont i_cont not_cont start end null not_null present blank |
id | Prefixed ID | eq not_eq in not_in null not_null |
minimum_order_quantity | Number | eq not_eq in not_in lt lteq gt gteq null not_null |
order_multiple | Number | eq not_eq in not_in lt lteq gt gteq null not_null |
position | Number | eq not_eq in not_in lt lteq gt gteq null not_null |
product_id | Prefixed ID | eq not_eq in not_in null not_null |
purchase_unit | One of unit, carton | eq not_eq in not_in null not_null |
sku | Text | eq not_eq in not_in cont i_cont not_cont start end null not_null present blank |
track_inventory | True or false | eq not_eq in not_in true false null |
units_per_carton | Number | eq not_eq in not_in lt lteq gt gteq null not_null |
updated_at | Date and time | eq not_eq in not_in lt lteq gt gteq null not_null |
weight | Amount | eq not_eq in not_in lt lteq gt gteq null not_null |
width | Amount | eq not_eq in not_in lt lteq gt gteq null not_null |
Filters through associations
Filters through associations
q[option_values_id_eq]. The same predicates apply.| Prefix | Attributes |
|---|---|
option_values_ | created_at, id, label, name, position, updated_at |
prices_ | amount, compare_at_amount, created_at, currency, id, min_quantity, price_list_id, updated_at, variant_id |
prices_price_list_ | catalog_id, created_at, ends_at, id, match_policy, name, position, starts_at, status, updated_at |
product_ | available_on, created_at, description, discontinue_on, id, name, price, seller_id, slug, status, updated_at |
product_categories_ | automatic, children_count, created_at, depth, id, name, parent_id, permalink, position, pretty_name, products_count, updated_at |
product_channels_ | active, code, created_at, default, id, name, store_id, updated_at |
product_collections_ | automatic, created_at, id, name, permalink, position, products_count, sort_order, updated_at |
product_labels_ | created_at, id, name, updated_at |
product_option_types_ | created_at, id, kind, label, name, position, updated_at |
product_product_categories_ | category_id, created_at, id, position, product_id, updated_at |
product_product_type_ | created_at, id, name, updated_at |
product_seller_ | contact_email, created_at, id, name, status, updated_at |
product_store_ | created_at, id, name, updated_at |
product_tags_ | created_at, id, name, updated_at |
seller_ | contact_email, created_at, id, name, status, updated_at |
tax_category_ | created_at, id, is_default, name, tax_code, updated_at |
carton_package_type_id, carton_weight, cartons_per_pallet, cost_currency, cost_price, country_of_origin, created_at, deleted_at, depth, discontinue_on, height, hs_code, id, minimum_order_quantity, order_multiple, position, product_id, purchase_unit, sku, track_inventory, units_per_carton, updated_at, weight, width. Prefix a field with - to sort descending.Authorizations
Secret API key for admin access
JWT token for admin user authentication
Headers
Bearer token for admin authentication
Path Parameters
Product ID
Query Parameters
Matches SKU, option value or product name (partial, case-insensitive; at least three characters).
Applies available_at_stock_location to the given value.
Applies product_name_or_sku_cont to the given value.
Applies search_by_product_name_or_sku to the given value.
Page number
Number of records per page
Comma-separated associations to expand (e.g., images, prices, stock_levels, option_values). Use dot notation for nested expand (max 4 levels).
Comma-separated list of fields to include (e.g., sku,price,stock). id is always included.
Attribute filters, as q[<attribute>_<predicate>]=value. See Filters above for the list.
Response
variants found
Was this page helpful?

