Update product
Updates an existing product. All fields are optional — only supplied fields are updated.
Requires admin scope.
PUT
/shops/{shop_id}/products/{id}Authorization
AuthorizationBearer token (JWT) · headerrequiredOAuth 2.0 Bearer token. Obtain via `POST https://auth.onbolder.com/oauth/token`.
Scopes:
adminPath parameters
shop_idstringrequiredShop ID or subdomain
idstringrequiredProduct ID or slug
Request body
requiredapplication/jsontitlestringProduct title. Required on create.
priceintegerPrice in cents
price_comparisoninteger"Was" price in cents
descriptionstringstatusstringdefault: "hidden"
Allowed:
visiblehiddenproduct_type_namestringName for new or existing product type
vendorstringtagsstring[]collectionsobject[]Show propertiesHide properties
Array of
objectidintegerAssign existing collection by ID
titlestringCreate and assign new collection by title
variantsVariantInput[]Show propertiesHide properties
Array of
VariantInputtitlestringRequired on create
skustringMust be unique within the shop
stockintegerdefault: 1
available_if_no_stockinteger`1` = 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)
custom_attributesCustomAttributeInput[]Show propertiesHide properties
Array of
CustomAttributeInputnamestringrequiredvaluestringrequiredfield_typestringdefault: "string"
Allowed:
stringemailurlintbooleanrequiredbooleandefault: false
Responses
200Product updated
idstringslugstringtitlestringstatusstringAllowed:
visiblehiddenpriceintegerPrice in cents
price_comparisoninteger | nullOriginal/comparison price in cents ("was" price)
discount_percentagenumber | nullcurrency_codestringvendorstringtagsstring[]created_onstring<date-time>updated_onstring<date-time>_linksobject_embeddedobjectShow propertiesHide properties
variantsVariantDetails[]Show propertiesHide properties
Array of
VariantDetailsidintegertitlestringskustring | nullpriceintegerprice_comparisoninteger | nullstockintegeravailable_if_no_stockbooleanweight_in_gramsinteger_linksobjectimagesProductImage[]Show propertiesHide properties
Array of
ProductImagefile_namestringtitlestring_linksImageLinksLinks to image at various sizes
Show propertiesHide properties
thumbnailHalLinkShow propertiesHide properties
hrefstringmethodstringtitlestringtypestringtemplatedbooleansmallHalLinkShow propertiesHide properties
hrefstringmethodstringtitlestringtypestringtemplatedbooleanmediumHalLinkShow propertiesHide properties
hrefstringmethodstringtitlestringtypestringtemplatedbooleanlargeHalLinkShow propertiesHide properties
hrefstringmethodstringtitlestringtypestringtemplatedbooleanoriginalHalLinkShow propertiesHide properties
hrefstringmethodstringtitlestringtypestringtemplatedbooleancollectionsCollection[]Show propertiesHide properties
Array of
Collectionidintegertitlestringslugstringshop_idintegercustom_attributesCustomAttribute[]Show propertiesHide properties
Array of
CustomAttributeidintegernamestringvaluestringfield_typestringAllowed:
stringemailurlintbooleanrequiredbooleankeystringdescriptionstring422Validation errors
_classstring[]_embeddedobjectShow propertiesHide properties
errorsobject[]Show propertiesHide properties
Array of
object_classstring[]fieldstringmessagesstring[]Request
curl -X PUT "https://api.onbolder.com/v1/shops/string/products/string" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "string",
"price": 0,
"price_comparison": 0,
"description": "string",
"status": "visible",
"product_type_name": "string",
"vendor": "string",
"tags": [
"string"
],
"collections": [
{
"id": 0,
"title": "string"
}
],
"variants": [
{
"title": "string",
"sku": "string",
"stock": 1,
"available_if_no_stock": 0,
"weight_in_grams": 0,
"price": 0,
"price_comparison": 0
}
],
"custom_attributes": [
{
"name": "string",
"value": "string",
"field_type": "string",
"required": false
}
]
}'const response = await fetch("https://api.onbolder.com/v1/shops/string/products/string", {
method: "PUT",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"title": "string",
"price": 0,
"price_comparison": 0,
"description": "string",
"status": "visible",
"product_type_name": "string",
"vendor": "string",
"tags": [
"string"
],
"collections": [
{
"id": 0,
"title": "string"
}
],
"variants": [
{
"title": "string",
"sku": "string",
"stock": 1,
"available_if_no_stock": 0,
"weight_in_grams": 0,
"price": 0,
"price_comparison": 0
}
],
"custom_attributes": [
{
"name": "string",
"value": "string",
"field_type": "string",
"required": false
}
]
})
});import requests
response = requests.put(
"https://api.onbolder.com/v1/shops/string/products/string",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"title": "string",
"price": 0,
"price_comparison": 0,
"description": "string",
"status": "visible",
"product_type_name": "string",
"vendor": "string",
"tags": [
"string"
],
"collections": [
{
"id": 0,
"title": "string"
}
],
"variants": [
{
"title": "string",
"sku": "string",
"stock": 1,
"available_if_no_stock": 0,
"weight_in_grams": 0,
"price": 0,
"price_comparison": 0
}
],
"custom_attributes": [
{
"name": "string",
"value": "string",
"field_type": "string",
"required": False
}
]
},
)Response
{
"id": "string",
"slug": "string",
"title": "string",
"status": "visible",
"price": 0,
"price_comparison": 0,
"discount_percentage": 0,
"currency_code": "string",
"vendor": "string",
"tags": [
"string"
],
"created_on": "2019-08-24T14:15:22Z",
"updated_on": "2019-08-24T14:15:22Z",
"_links": {},
"_embedded": {
"shop": {
"id": "string",
"name": "string",
"subdomain": "string",
"url": "string",
"description": "string",
"currency_code": "string",
"locale": "string",
"created_on": "2019-08-24T14:15:22Z",
"updated_on": "2019-08-24T14:15:22Z",
"product_counts": {
"visible": 0,
"hidden": 0
},
"_links": {}
},
"image": {
"file_name": "string",
"title": "string",
"_links": {
"thumbnail": {
"href": "string",
"method": "string",
"title": "string",
"type": "string",
"templated": true
},
"small": {
"href": "string",
"method": "string",
"title": "string",
"type": "string",
"templated": true
},
"medium": {
"href": "string",
"method": "string",
"title": "string",
"type": "string",
"templated": true
},
"large": {
"href": "string",
"method": "string",
"title": "string",
"type": "string",
"templated": true
},
"original": {
"href": "string",
"method": "string",
"title": "string",
"type": "string",
"templated": true
}
}
},
"variants": [
{
"id": 0,
"title": "string",
"sku": "string",
"price": 0,
"price_comparison": 0,
"stock": 0,
"available_if_no_stock": true,
"weight_in_grams": 0,
"_links": {}
}
],
"collections": [
{
"id": 0,
"title": "string",
"slug": "string",
"shop_id": 0
}
],
"images": [
{
"file_name": "string",
"title": "string",
"_links": {
"thumbnail": {
"href": "string",
"method": "string",
"title": "string",
"type": "string",
"templated": true
},
"small": {
"href": "string",
"method": "string",
"title": "string",
"type": "string",
"templated": true
},
"medium": {
"href": "string",
"method": "string",
"title": "string",
"type": "string",
"templated": true
},
"large": {
"href": "string",
"method": "string",
"title": "string",
"type": "string",
"templated": true
},
"original": {
"href": "string",
"method": "string",
"title": "string",
"type": "string",
"templated": true
}
}
}
],
"custom_attributes": [
{
"id": 0,
"name": "string",
"value": "string",
"field_type": "string",
"required": true,
"key": "string"
}
]
},
"description": "string"
}{
"_class": [
"string"
],
"_embedded": {
"errors": [
{
"_class": [
"string"
],
"field": "string",
"messages": [
"string"
]
}
]
}
}