Template Docs Commerce APIs Webhooks
Get Started
Get Started

Delete a product image

DELETE https://api.squarespace.com/{api-version}/commerce/products/{productId}/images/{imageId}

Deletes an image in a product’s collection of images.

A successful request deletes a ProductImage and removes any references to it from the parent Product and its ProductVariant subresources. Read the Overview to learn more about these resources.

Parameters

If needed, see the "Related endpoints" section to learn how to retrieve resource ids.

{api-version} string
required

See the Products API Overview page for the current API version.


{productId} string
required

Specifies the parent Product of the ProductImage


{imageId} string
required

Specifies the ProductImage to delete.

Request example

Read the Making requests guide to learn why specific headers are necessary, and why some are omitted. Every request should also abide by Squarespace rate limits.

curl "https://api.squarespace.com/1.0/commerce/products/123/images/456" \
  -i \
  -H "Authorization: Bearer YOUR_API_KEY_OR_OAUTH_TOKEN" \
  -H "User-Agent: YOUR_CUSTOM_APP_DESCRIPTION" \
  -X DELETE

Response example

A response to a successful request will not contain any data.

Status codes and error conditions

204 NO CONTENT

The ProductImage was deleted successfully.


404 NOT FOUND

Type: INVALID_REQUEST_ERROR

Subtype: INVALID_ARGUMENT
Either the Product or the ProductImage was not found.

Related endpoints

To retrieve ids for Products and their ProductVariants and ProductImages, use these suggested endpoints: