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

Update variant

Updates an existing variant. You can also look up the variant by sku instead of id by passing ?sku=YOUR_SKU as a query parameter. Requires admin scope.

PUT/shops/{shop_id}/variants/{id}
Authorization
AuthorizationBearer token (JWT) · headerrequired

OAuth 2.0 Bearer token. Obtain via POST https://auth.onbolder.com/oauth/token.

Scopes:admin
Path parameters
shop_idstringrequired

Shop ID or subdomain

idstringrequired

Variant ID (or any value when using ?sku= lookup)

Query parameters
skustring

Look up variant by SKU instead of ID

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
200

Variant updated

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 PUT 'https://api.onbolder.com/v1/shops/string/variants/string' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "title": "string",
  "position": 0,
  "sku": "string",
  "stock": 1,
  "available_if_no_stock": 0,
  "weight_in_grams": 0,
  "price": 0,
  "price_comparison": 0
}'
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?