Spree Admin SDK
import { createAdminClient } from '@spree/admin-sdk'
const client = createAdminClient({
baseUrl: 'https://your-store.com',
secretKey: 'sk_xxx',
})
const variant = await client.products.variants.get('prod_86Rf07xd4z', 'variant_k5nR8xLq', {
expand: ['prices', 'stock_levels'],
})spree api get /products/{product_id}/variants/{id} -d '{"expand":["prices","stock_levels"]}'{
"id": "variant_gbHJdmfrXB",
"product_id": "prod_UkLWZg9DAJ",
"sku": "SKU-292",
"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": 19.33,
"height": 158.93,
"width": 166.27,
"depth": 20.71,
"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-73",
"label": "S",
"position": 1,
"color_code": null,
"option_type_name": "foo-size-83",
"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 2174025",
"delivery_profile_id": "fp_UkLWZg9DAJ"
}{
"error": {
"code": "variant_not_found",
"message": "Variant not found"
}
}Get a variant
Returns a single variant by ID.
Required scope: read_products (for API-key authentication).
GET
/
api
/
v3
/
admin
/
products
/
{product_id}
/
variants
/
{id}
Spree Admin SDK
import { createAdminClient } from '@spree/admin-sdk'
const client = createAdminClient({
baseUrl: 'https://your-store.com',
secretKey: 'sk_xxx',
})
const variant = await client.products.variants.get('prod_86Rf07xd4z', 'variant_k5nR8xLq', {
expand: ['prices', 'stock_levels'],
})spree api get /products/{product_id}/variants/{id} -d '{"expand":["prices","stock_levels"]}'{
"id": "variant_gbHJdmfrXB",
"product_id": "prod_UkLWZg9DAJ",
"sku": "SKU-292",
"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": 19.33,
"height": 158.93,
"width": 166.27,
"depth": 20.71,
"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-73",
"label": "S",
"position": 1,
"color_code": null,
"option_type_name": "foo-size-83",
"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 2174025",
"delivery_profile_id": "fp_UkLWZg9DAJ"
}{
"error": {
"code": "variant_not_found",
"message": "Variant not found"
}
}Authorizations
Secret API key for admin access
JWT token for admin user authentication
Headers
Bearer token for admin authentication
Query Parameters
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.
Response
variant found
Was this page helpful?
⌘I

