Upload a product image
Scope: inventory:products.write https://api.alladdin.com/api/v2/products/{productId}/images
Uploads 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 string required
Product ID (24-char hex ObjectId)
Request body
object file string<binary> required
Image file (jpeg, png, gif)
Request
import requests
url = "https://api.alladdin.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
{
"id": "507f1f77bcf86cd799439011"
}Success responses
201 Image uploaded application/json object id string required
Error responses
400 Bad request application/json 401 Invalid or missing API key application/json 403 Insufficient permissions application/json 404 Product not found application/json 422 Validation error application/json 429 Rate limit exceeded application/json
