Create variant
Adds a new variant to an existing product. Requires admin scope.
POST
/products/{product_id}/variantsAuthorization
AuthorizationBearer token (JWT) · headerrequiredOAuth 2.0 Bearer token. Obtain via POST https://auth.onbolder.com/oauth/token.
Scopes:
adminPath parameters
product_idstringrequiredProduct ID or slug
Request body
requiredapplication/jsontitlestringRequired on create
positionintegerOrdering position (lower comes first). On a chained-variants product, omitting it on create defaults to the current highest position instead of 0.
skustringMust be unique within the shop
stockintegerdefault: 1
available_if_no_stockinteger1 = always available, 0 = unavailable when out of stock
default: 1
Allowed:
01weight_in_gramsintegerpriceintegerOverride product price for this variant (cents)
price_comparisonintegerOverride comparison price for this variant (cents)
Responses
201
Variant created
idintegertitlestringpositionintegerskustring | nullpriceintegerprice_comparisoninteger | nullstockintegeravailable_if_no_stockbooleanweight_in_gramsinteger_linksobject422
Validation errors
_classstring[]_embeddedobjectShow propertiesHide properties
errorsobject[]Show propertiesHide properties
Array of
object_classstring[]fieldstringmessagesstring[]