Saltar al contenido principal
POST

Subir una imagen de producto

Scope:inventory:products.write
https://api.holded.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.

Parámetros

Parámetros de ruta

productIdstringobligatorio

ID del producto (ObjectId hexadecimal de 24 caracteres)

Cuerpo de la petición

object
filestring<binary>required

Image file (jpeg, png, gif)

Petición

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())

Respuestas

Respuesta

json
{
  "id": "507f1f77bcf86cd799439011"
}

Respuestas exitosas

201Imagen subida correctamenteapplication/json
object
idstringrequired

Respuestas de error

400Petición incorrectaapplication/json
401API key inválida o no proporcionadaapplication/json
403Permisos insuficientesapplication/json
404Producto no encontradoapplication/json
422Entidad no procesableapplication/json
429Límite de solicitudes excedidoapplication/json