Skip to main content

Create Variation

Create a new product variation for a store product. The variation name is automatically generated from the selected option values.

Endpointโ€‹

POST /v1/store-products/{id}/variations

Authenticationโ€‹

Requires an API key with the store:write scope.

Parametersโ€‹

ParameterTypeLocationDescription
idintegerpathThe store product ID

Request Bodyโ€‹

FieldTypeRequiredDescription
skustringNoStock keeping unit for this variation (max 255 characters)
price_overridenumberNoPrice override for this variation (min 0). Omit or set to null to use the base product price.
stock_quantityintegerNoInitial stock quantity (min 0, default: 0)
option_valuesarrayYesArray of option value objects (min 1 item)
option_values[].option_idintegerYesThe variation option ID (must belong to this product)
option_values[].valuestringYesThe selected value for this option (max 100 characters)
tip

The variation name is auto-generated by joining the option values with " / " (e.g., selecting "Small" for Size and "Red" for Color produces the name "Small / Red").

Responseโ€‹

Success (201 Created)โ€‹

{
"data": {
"id": 1,
"name": "Small / Red",
"sku": "WIDGET-SM-R",
"price_override": 15.99,
"stock_quantity": 25,
"option_values": [
{
"option_id": 1,
"option_name": "Size",
"value": "Small"
},
{
"option_id": 2,
"option_name": "Color",
"value": "Red"
}
],
"created_at": "2026-02-15T12:00:00+00:00",
"updated_at": "2026-02-15T12:00:00+00:00"
},
"meta": {
"request_id": "req_abc123",
"timestamp": "2026-02-15T12:00:00+00:00"
}
}

Errorsโ€‹

StatusCodeDescription
401authentication_requiredNo API key provided
401invalid_api_keyInvalid API key
403insufficient_scopeAPI key lacks store:write scope
404resource_not_foundStore product does not exist
422validation_errorInvalid request body
422variations_not_enabledProduct does not have variations enabled
422variation_errorAn option_id does not belong to this product, or every option_values entry was blank
note

The option_id values in option_values must reference variation options that belong to the specified store product. Providing an option ID from a different product returns a 422 variation_error.

Values register themselves

Creating a variation adds each value to its variation option's values list automatically, so you don't have to maintain that list separately โ€” sending {"option_id": 3, "value": "S"} makes "S" a known value of that option.

Example Requestโ€‹

curl -X POST "https://app.equipdash.com/api/v1/store-products/1/variations" \
-H "Authorization: Bearer eqd_live_abc123xyz789..." \
-H "Content-Type: application/json" \
-d '{
"sku": "WIDGET-SM-R",
"price_override": 15.99,
"stock_quantity": 25,
"option_values": [
{
"option_id": 1,
"value": "Small"
},
{
"option_id": 2,
"value": "Red"
}
]
}'