Skip to content
BolderBolder API
Esc
navigateopen⌘Jpreview

Create variant

Adds a new variant to an existing product. Requires admin scope.

POST/products/{product_id}/variants
Authorization
AuthorizationBearer token (JWT) · headerrequired
OAuth 2.0 Bearer token. Obtain via `POST https://auth.onbolder.com/oauth/token`.
Scopes:admin
Path parameters
product_idstringrequired
Product ID or slug
Request body
requiredapplication/json
titlestring
Required on create
skustring
Must be unique within the shop
stockinteger
default: 1
available_if_no_stockinteger
`1` = always available, `0` = unavailable when out of stock
default: 1
Allowed:01
weight_in_gramsinteger
priceinteger
Override product price for this variant (cents)
price_comparisoninteger
Override comparison price for this variant (cents)
Responses
201Variant created
idinteger
titlestring
skustring | null
priceinteger
price_comparisoninteger | null
stockinteger
available_if_no_stockboolean
weight_in_gramsinteger
_linksobject
422Validation errors
_classstring[]
_embeddedobject
Show properties
errorsobject[]
Show properties
Array of object
_classstring[]
fieldstring
messagesstring[]
Request
curl -X POST "https://api.onbolder.com/v1/products/string/variants" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "title": "string",
  "sku": "string",
  "stock": 1,
  "available_if_no_stock": 0,
  "weight_in_grams": 0,
  "price": 0,
  "price_comparison": 0
}'
Response
{
  "id": 0,
  "title": "string",
  "sku": "string",
  "price": 0,
  "price_comparison": 0,
  "stock": 0,
  "available_if_no_stock": true,
  "weight_in_grams": 0,
  "_links": {}
}