Upload product image
Uploads a new image to a product. The image data must be Base64-encoded and sent in the
data field along with the file name and MIME type. Requires admin scope.
POST
/products/{product_id}/assetsAuthorization
AuthorizationBearer token (JWT) · headerrequiredOAuth 2.0 Bearer token. Obtain via `POST https://auth.onbolder.com/oauth/token`.
Scopes:
adminPath parameters
product_idstringrequiredProduct ID or slug
Request body
requiredapplication/jsondatastringrequiredBase64-encoded image data URI (`data:image/jpeg;base64,...`)
file_namestringrequiredtitlestringdescriptionstringResponses
201Image uploaded
file_namestringtitlestringdescriptionstring_linksobjectShow propertiesHide properties
thumbnailHalLinkShow propertiesHide properties
hrefstringmethodstringtitlestringtypestringtemplatedbooleansmallHalLinkShow propertiesHide properties
hrefstringmethodstringtitlestringtypestringtemplatedbooleanmediumHalLinkShow propertiesHide properties
hrefstringmethodstringtitlestringtypestringtemplatedbooleanlargeHalLinkShow propertiesHide properties
hrefstringmethodstringtitlestringtypestringtemplatedbooleanoriginalHalLinkShow propertiesHide properties
hrefstringmethodstringtitlestringtypestringtemplatedbooleanbtc:delete_product_assetHalLinkShow propertiesHide properties
hrefstringmethodstringtitlestringtypestringtemplatedboolean422Validation errors
_classstring[]_embeddedobjectShow propertiesHide properties
errorsobject[]Show propertiesHide properties
Array of
object_classstring[]fieldstringmessagesstring[]Request
curl -X POST "https://api.onbolder.com/v1/products/string/assets" \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"data": "string",
"file_name": "string",
"title": "string",
"description": "string"
}'const response = await fetch("https://api.onbolder.com/v1/products/string/assets", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
body: JSON.stringify({
"data": "string",
"file_name": "string",
"title": "string",
"description": "string"
})
});import requests
response = requests.post(
"https://api.onbolder.com/v1/products/string/assets",
headers={
"Authorization": "Bearer YOUR_TOKEN",
"Content-Type": "application/json"
},
json={
"data": "string",
"file_name": "string",
"title": "string",
"description": "string"
},
)Response
{
"file_name": "string",
"title": "string",
"description": "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
},
"btc:delete_product_asset": {
"href": "string",
"method": "string",
"title": "string",
"type": "string",
"templated": true
}
}
}{
"_class": [
"string"
],
"_embedded": {
"errors": [
{
"_class": [
"string"
],
"field": "string",
"messages": [
"string"
]
}
]
}
}