Removes an image from a product. The image file stays on the server.
Note
This function does not remove the image from the server, just the image assignment from the product.
Before you begin#
- The API token needs
ProductImage_Delete, either assigned directly under Functions or through a group. See Create an API token. - Requests must be signed if the token requires it. See Make a signed request with HMAC.
- You need the
ProductImage_IDof the image to remove.
Example requests#
Remove an image from a product#
Removes product image 1 from its product.
{
"Store_Code": "{{Store_Code}}",
"Miva_Request_Timestamp": "{{$timestamp}}",
"Function": "ProductImage_Delete",
"ProductImage_ID": 1
}
Request parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
ProductImage_ID |
Number | Yes | Image Id to remove |
Example response#
{
"success": 1
}
Response parameters#
| Parameter | Type | Description |
|---|---|---|
success |
Boolean | Boolean value for if the request was successful |
Error responses#
| error field | error message | description |
|---|---|---|
| Error | Missing required parameter | Missing ProductImage_ID parameter |
Related functions#
| Function | Use it to |
|---|---|
ProductImage_Add |
Add an image to a product |
ProductImage_Update_Type |
Change the image type of a product image |
ImageTypeList_Load_Query |
List the store’s image types |
ProductList_Load_Query |
See a product’s images with the productimagedata on-demand column |
Try in Postman#
In the Miva: JSON API: Authenticated collection, open Products > ProductImage_Delete. See Set Up Postman.