Skip to content
BolderBolder Developers
Esc
↑↓navigate↵open⌘Jpreview

Create a variant

Creates a new variant for a product.

POST/products/{product_id}/variants
Authorization
AuthorizationBearer token (JWT) · headerrequired
Path parameters
product_idstringrequired
Request body
requiredapplication/json
idinteger

Pre-assign a specific variant ID (rarely used; usually omitted).

positioninteger

Ordering position within the product (lower comes first). On a chained_variants product, omitting it defaults to the current highest position instead of 0.

option1string
option2string
option3string
option_valuesobject

Custom variant option values, keyed by option1/option2/option3.

option_asset_idsobject

Asset IDs to associate with each option value.

product_asset_idsinteger[]

Product image asset IDs to associate with this variant.

skustring
barcode_numberstring
regular_priceinteger

In cents. Required if the product has per-variant prices.

sale_priceinteger

In cents

costinteger
weight_in_gramsinteger
unit_quantitynumber
colorstring
available_if_no_stockboolean
default: false
online_stockinteger
statusstring
Allowed:visiblehidden
stocksobject[]
Show properties
Array of object
location_idinteger
unitsinteger
Responses
201

Variant created

_linksHalLinks
idinteger
product_idinteger
namestring

Display name, computed from option1/option2/option3.

positioninteger

Ordering position within the product. Lower comes first. For products with chained_variants enabled this drives which variant stays visible (lowest position, then cheapest, then lowest id).

statusstring
Allowed:visiblehidden
skustring
barcode_numberstring
option1string
option2string
option3string
currency_codestring
regular_priceinteger

Regular price in cents

sale_priceinteger | null

Sale price in cents

priceinteger

Effective price in cents (sale_price if set, else regular_price)

online_stockinteger
all_stockinteger
available_if_no_stockboolean
weight_in_gramsinteger
unit_quantitynumber
colorstring
costinteger
profitinteger
stocksobject[]

Per-location stock breakdown

Show properties
Array of object
location_idinteger
available_unitsinteger
total_unitsinteger
Try it
Server
Authorization
Parameters
Bodyapplication/json
Request
curl -X POST 'https://api.onbolder.com/v2/products/string/variants' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "option1": "Large",
  "sku": "WH-001-L",
  "regular_price": 8999,
  "stocks": [
    {
      "location_id": 1,
      "units": 15
    }
  ]
}'
Response
{
  "id": 202,
  "product_id": 101,
  "name": "Large",
  "sku": "WH-001-L",
  "regular_price": 8999,
  "price": 8999
}

Was this page helpful?