Product Media API: Upload without linking & deletion

Highlighted
Shopify Partner
12 0 1

Hi,

I recently ran into https://shopify.dev/tutorials/manage-product-media-with-admin-api and have two questions.

 

1) The upload is a three step process, where I will (1) request to upload a file, (2) upload the file to S3 and (3) link the file to a product.

1.1 What happens if the uploaded media is never linked to a product? Is that okay?

1.2 Will it be deleted after a while?

 

2) The operation described in "Deleting media objects" will actually delete the media file on S3. After that operation the file is not anymore available on S3.

2.1 Do I understand that correctly?

2.2 What happens with the linked product, will it point to a 404 location?

 

Regards
Markus

 

0 Likes
Highlighted
Shopify Staff
Shopify Staff
144 18 22

Hey @Markus_Arndt 

I'm not aware of any specific rules for deleting unlinked or stale media. Regarding the delete mutation, this will remove the association of the media with the product, but doesn't affect what is uploaded to S3. For example, if you were to upload an image and then associate it with a product, you could then remove that association using the deleteProductMedia mutation, and then associate it with a different product. 

Kevin_A | Developer Support @ Shopify
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Click Accept as Solution 

0 Likes