Skip to content

Update Images (Admin)

Delete images for a product variant for admin.

Endpoint

PUT /v1/products/variant/image/admin/?id={variant_id}&product_id={product_id}

Authentication

Required (Admin role)

Query Parameters

Parameter Type Required Description
id integer Yes Variant ID
product_id integer Yes Product ID

Request Body

Content-Type: multipart/form-data

Form Fields

Field Type Required Description
delete_images string No Comma-separated image IDs to delete

Response

Success (200 OK)

{
  "success": "Product Images Updated"
}

Error Responses

Product Not Found (404)

{
  "error": "Product not found"
}

Variant Not Found (404)

{
  "error": "Product Variant not found"
}

Example Request

curl -X PUT "https://api.luxmart.site/v1/products/variant/image/admin/?id=1&product_id=5" \
  -H "Authorization: Token your_access_token" \
  -F "delete_images=3,4"

Notes

  • Variant must belong to the specified product
  • Images are soft deleted (sets is_deleted: true)
  • Deleted images cannot be retrieved
  • Admin can delete images from variants in any store