Replace media
POST
/ admin/ v1/ stores/ {store_id}/ media/ {media_id}/ replacement- products:write
- content:write
- Idempotency-Key supported
Reserve new bytes under the same media ID, so everything that uses the file shows the new one. Send the file to the files edge as upload says, then call …/replacement/complete with the edge's receipt. The new file must be the same kind.
Path parameters
store_idstringrequiredThe store's ID, like
store_01k8qs5s…. Apps get it with the install, in the OAuth redirect and the token response.media_idstringrequiredThe media's ID, like
med_01k8qs5s….
Headers
Idempotency-KeystringSend the same key to retry safely: the first answer is replayed for 24 hours.
shop-api-versionYYYY-MMThe version to answer in. Without it, your app’s pinned version, else the newest.
Body
filenamestringrequiredcontent_typestringrequiredsize_bytesintegerrequired
Returns
201 Replacement slot created.
Errors
- 404
not_foundNo such media. - 409The file isn't uploaded yet.
- 422
validation_failedUnsupported type, size or name, or another kind of file.