Invalid id on delete?

Solved
BeamJokerFavor
Excursionist
36 2 2

I am trying to delete product images via the API. Below is my mutation, variables, and output:

   mutation = '''mutation productDeleteImages($id: ID!, $imageIds: [ID!]!) {
  productDeleteImages(id: $id, imageIds: $imageIds) {
    deletedImageIds
    product {
      id
    }
    userErrors {
      field
      message
    }
  }
}
  variables = {
        "imageIds": [image_gid],
        "id": pid
        }

 

pid: gid://shopify/Product/6143505137830
gid: gid://shopify/Model3d/20606458527910
{"data":{"productDeleteImages":null},"errors":[{"message":"invalid id","locations":[{"line":2,"column":3}],"path":["productDeleteImages"]}],"extensions":{"cost":{"requestedQueryCost":10,"actualQueryCost":1,"throttleStatus":{"maximumAvailable":1000.0,"currentlyAvailable":999,"restoreRate":50.0}}}}

Am I right to use the global ids?

Using the 2021-04 API

0 Likes
BeamJokerFavor
Excursionist
36 2 2

Is the invalid ID the product ID or the image ID?

0 Likes
BeamJokerFavor
Excursionist
36 2 2

This is an accepted solution.

Ah, a Model3d is not an image, it is a media. I needed to use the mutation productDeleteMedia