Skip to main content
POST
/
api
/
dashboard
/
products
/
{product_id}
/
variants
Create Variant
curl --request POST \
  --url https://api.example.com/api/dashboard/products/{product_id}/variants \
  --header 'Content-Type: application/json' \
  --data '
{
  "price": 1,
  "sku": "<string>",
  "barcode": "<string>",
  "option1": "<string>",
  "option2": "<string>",
  "option3": "<string>",
  "compare_at_price": 1,
  "cost_per_item": 1,
  "inventory_quantity": 0,
  "inventory_policy": "deny",
  "low_stock_threshold": 10,
  "weight": 123,
  "weight_unit": "kg",
  "requires_shipping": true,
  "image_url": "<string>",
  "available": true
}
'
{
  "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "product_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "sku": "<string>",
  "barcode": "<string>",
  "option1": "<string>",
  "option2": "<string>",
  "option3": "<string>",
  "price": "<string>",
  "compare_at_price": "<string>",
  "cost_per_item": "<string>",
  "inventory_quantity": 123,
  "inventory_policy": "<string>",
  "low_stock_threshold": 123,
  "weight": "<string>",
  "weight_unit": "<string>",
  "requires_shipping": true,
  "image_url": "<string>",
  "available": true,
  "is_low_stock": true,
  "is_out_of_stock": true,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Documentation Index

Fetch the complete documentation index at: https://docs.stella-commerce.com/llms.txt

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

Headers

authorization
string | null
X-API-Key
string | null
X-Stella-Merchant-Id
string | null

Path Parameters

product_id
string<uuid>
required

Body

application/json

Schema for creating a variant.

price
required
Required range: x >= 0
sku
string | null
Maximum string length: 100
barcode
string | null
Maximum string length: 100
option1
string | null
Maximum string length: 100
option2
string | null
Maximum string length: 100
option3
string | null
Maximum string length: 100
compare_at_price
Required range: x >= 0
cost_per_item
Required range: x >= 0
inventory_quantity
integer
default:0
Required range: x >= 0
inventory_policy
string
default:deny
Pattern: ^(deny|continue)$
low_stock_threshold
integer
default:10
Required range: x >= 0
weight
weight_unit
string
default:kg
Pattern: ^(kg|g|lb|oz)$
requires_shipping
boolean
default:true
image_url
string | null
available
boolean
default:true

Response

Successful Response

Schema for variant in responses.

id
string<uuid>
required
product_id
string<uuid>
required
sku
string | null
required
barcode
string | null
required
option1
string | null
required
option2
string | null
required
option3
string | null
required
price
string
required
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
compare_at_price
string | null
required
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
cost_per_item
string | null
required
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
inventory_quantity
integer
required
inventory_policy
string
required
low_stock_threshold
integer
required
weight
string | null
required
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
weight_unit
string
required
requires_shipping
boolean
required
image_url
string | null
required
available
boolean
required
is_low_stock
boolean
required
is_out_of_stock
boolean
required
created_at
string<date-time>
required
updated_at
string<date-time>
required