Skip to content
BolderBolder Developers
Esc
↑↓navigate↵open⌘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

positioninteger

Ordering position (lower comes first). On a chained-variants product, omitting it on create defaults to the current highest position instead of 0.

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
201

Variant created

idinteger
titlestring
positioninteger
skustring | null
priceinteger
price_comparisoninteger | null
stockinteger
available_if_no_stockboolean
weight_in_gramsinteger
_linksobject
422

Validation errors

_classstring[]
_embeddedobject
Show properties
errorsobject[]
Show properties
Array of object
_classstring[]
fieldstring
messagesstring[]
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://api.onbolder.com/v1/products/string/variants' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "title": "Large",
  "sku": "SKU-LG",
  "stock": 10,
  "available_if_no_stock": 0,
  "weight_in_grams": 200
}'
Response
{
  "id": 0,
  "title": "string",
  "position": 0,
  "sku": "string",
  "price": 0,
  "price_comparison": 0,
  "stock": 0,
  "available_if_no_stock": true,
  "weight_in_grams": 0,
  "_links": {}
}

Was this page helpful?