POST
Upload a product image
Scope:
inventory:products.writehttps://api.holded.com/api/v2/products/{productId}/imagesUploads an image and associates it with the specified product. Send the file as `multipart/form-data` using the `file` field. Allowed image types: jpeg, png, gif. Maximum 200 images per product.
Parameters
Path parameters
productId
stringrequiredProduct ID (24-char hex ObjectId)
Request body
object
filestring<binary>required
Image file (jpeg, png, gif)
Request
python
import requests
url = "https://api.holded.com/api/v2/products/{productId}/images"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
}
files = {"file": open("file.pdf", "rb")}
response = requests.post(url, headers=headers, files=files)
print(response.json())Responses
Response
json
{
"id": "507f1f77bcf86cd799439011"
}Success responses
201Image uploadedapplication/jsonobject
idstringrequired
Error responses
400Bad requestapplication/json401Invalid or missing API keyapplication/json403Insufficient permissionsapplication/json404Product not foundapplication/json422Validation errorapplication/json429Rate limit exceededapplication/json