Skip to main content
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_items'],
})
{
  "id": "variant_gbHJdmfrXB",
  "product_id": "prod_UkLWZg9DAJ",
  "sku": "SKU-63",
  "options_text": "Size: S",
  "track_inventory": true,
  "media_count": 0,
  "thumbnail_url": null,
  "purchasable": true,
  "in_stock": false,
  "backorderable": true,
  "weight": 21.18,
  "height": 160,
  "width": 127.7,
  "depth": 17.83,
  "price": {
    "id": "price_gbHJdmfrXB",
    "amount": "19.99",
    "amount_in_cents": 1999,
    "compare_at_amount": null,
    "compare_at_amount_in_cents": null,
    "currency": "USD",
    "display_amount": "$19.99",
    "display_compare_at_amount": null,
    "price_list_id": null
  },
  "original_price": null,
  "option_values": [
    {
      "id": "optval_UkLWZg9DAJ",
      "option_type_id": "opt_UkLWZg9DAJ",
      "name": "size-10",
      "label": "S",
      "position": 1,
      "color_code": null,
      "option_type_name": "foo-size-19",
      "option_type_label": "Size",
      "image_url": null,
      "metadata": {},
      "created_at": "2026-05-21T18:11:49.893Z",
      "updated_at": "2026-05-21T18:11:49.893Z"
    }
  ],
  "metadata": {},
  "position": 2,
  "cost_price": "17.0",
  "cost_currency": "USD",
  "barcode": null,
  "weight_unit": "lb",
  "dimensions_unit": null,
  "deleted_at": null,
  "created_at": "2026-05-21T18:11:49.887Z",
  "updated_at": "2026-05-21T18:11:49.910Z",
  "tax_category_id": "taxcat_UkLWZg9DAJ",
  "available_stock": 0,
  "reserved_quantity": 0,
  "total_on_hand": 0,
  "product_name": "Product 537070"
}

Documentation Index

Fetch the complete documentation index at: https://spreecommerce.org/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

x-spree-api-key
string
header
required

Secret API key for admin access

Authorization
string
header
required

JWT token for admin user authentication

Headers

x-spree-api-key
string
required
Authorization
string
required

Bearer token for admin authentication

Path Parameters

product_id
string
required

Product ID

id
string
required

Variant ID

Query Parameters

expand
string

Comma-separated associations to expand (e.g., images, prices, stock_items, option_values). Use dot notation for nested expand (max 4 levels).

fields
string

Comma-separated list of fields to include (e.g., sku,price,stock). id is always included.

Response

variant found