curl --request POST \
--url 'https://prod-api.stateset.cloud.stateset.app/api/v1/products/{id}/variants' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"compare_at_price": "49.00",
"cost": "49.00",
"dimensions": {
"height": 1.5,
"length": 1.5,
"unit": "cm",
"width": 1.5
},
"inventory_tracking": true,
"name": "Ada Lovelace",
"options": {},
"position": 1,
"price": "49.00",
"sku": "SKU-TENT-2P-GRN",
"weight": 1.2
}'
{
"data": {
"compare_at_price": "199.99",
"cost": "75.00",
"created_at": "2024-12-09T10:30:00Z",
"dimensions": {
"height": 8,
"length": 20,
"width": 18
},
"id": "660e8400-e29b-41d4-a716-446655440001",
"inventory_tracking": true,
"name": "Wireless Bluetooth Headphones - Large",
"options": {
"color": "Black",
"size": "Large"
},
"position": 1,
"price": "149.99",
"product_id": "550e8400-e29b-41d4-a716-446655440000",
"sku": "WBH-BLK-001-L",
"updated_at": "2024-12-09T14:45:00Z",
"weight": 0.35
},
"errors": [
"string"
],
"message": "Two-person tent, green — replacement for damaged pole set.",
"meta": {
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"timestamp": "2026-08-31T14:22:05Z"
},
"success": true
}
Create a product variant
Create a product variant
POST
/
api
/
v1
/
products
/
{id}
/
variants
curl --request POST \
--url 'https://prod-api.stateset.cloud.stateset.app/api/v1/products/{id}/variants' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"compare_at_price": "49.00",
"cost": "49.00",
"dimensions": {
"height": 1.5,
"length": 1.5,
"unit": "cm",
"width": 1.5
},
"inventory_tracking": true,
"name": "Ada Lovelace",
"options": {},
"position": 1,
"price": "49.00",
"sku": "SKU-TENT-2P-GRN",
"weight": 1.2
}'
{
"data": {
"compare_at_price": "199.99",
"cost": "75.00",
"created_at": "2024-12-09T10:30:00Z",
"dimensions": {
"height": 8,
"length": 20,
"width": 18
},
"id": "660e8400-e29b-41d4-a716-446655440001",
"inventory_tracking": true,
"name": "Wireless Bluetooth Headphones - Large",
"options": {
"color": "Black",
"size": "Large"
},
"position": 1,
"price": "149.99",
"product_id": "550e8400-e29b-41d4-a716-446655440000",
"sku": "WBH-BLK-001-L",
"updated_at": "2024-12-09T14:45:00Z",
"weight": 0.35
},
"errors": [
"string"
],
"message": "Two-person tent, green — replacement for damaged pole set.",
"meta": {
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"timestamp": "2026-08-31T14:22:05Z"
},
"success": true
}
Path parameters
string (uuid)
required
Product ID
Request body
CreateVariantRequest
string,null
string,null
Dimensions,null
boolean,null
string
required
object
required
integer,null (int32)
string
required
string
required
number,null (double)
Response
ApiResponse_VariantResponse
object
Show data
Show data
string,null
Original/compare-at price (for showing discounts)
string,null
Cost price
string (date-time)
required
Creation timestamp
Dimensions,null
string (uuid)
required
Variant UUID
boolean
required
Whether inventory is tracked for this variant
string
required
Variant display name
object
required
Variant options (e.g., size, color)
integer (int32)
required
Display position (for sorting)
string
required
Sale price
string (uuid)
required
Parent product UUID
string
required
Variant SKU
string (date-time)
required
Last update timestamp
number,null (double)
Weight in kilograms
array,null
string,null
boolean
required
Status codes
| Code | Meaning |
|---|---|
201 | Variant created |
400 | Invalid payload |
404 | Product not found |
curl --request POST \
--url 'https://prod-api.stateset.cloud.stateset.app/api/v1/products/{id}/variants' \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"compare_at_price": "49.00",
"cost": "49.00",
"dimensions": {
"height": 1.5,
"length": 1.5,
"unit": "cm",
"width": 1.5
},
"inventory_tracking": true,
"name": "Ada Lovelace",
"options": {},
"position": 1,
"price": "49.00",
"sku": "SKU-TENT-2P-GRN",
"weight": 1.2
}'
{
"data": {
"compare_at_price": "199.99",
"cost": "75.00",
"created_at": "2024-12-09T10:30:00Z",
"dimensions": {
"height": 8,
"length": 20,
"width": 18
},
"id": "660e8400-e29b-41d4-a716-446655440001",
"inventory_tracking": true,
"name": "Wireless Bluetooth Headphones - Large",
"options": {
"color": "Black",
"size": "Large"
},
"position": 1,
"price": "149.99",
"product_id": "550e8400-e29b-41d4-a716-446655440000",
"sku": "WBH-BLK-001-L",
"updated_at": "2024-12-09T14:45:00Z",
"weight": 0.35
},
"errors": [
"string"
],
"message": "Two-person tent, green — replacement for damaged pole set.",
"meta": {
"request_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"timestamp": "2026-08-31T14:22:05Z"
},
"success": true
}
Last modified on August 31, 2026