Shopify File Upload API 2026: Staged Uploads, fileCreate & Product Images in Your App
Shopify file upload API tutorial (2026): upload images from your own Shopify app with the GraphQL Admin API - stagedUploadsCreate, POST the file to the staged target, fileCreate, wait for READY, add the image to a product with fileUpdate, remove it and delete it, on a real development store. Shopify app development series, episode 10 - everything shown is real, nothing skipped.
What you'll learn
- The write_files scope (and what works without it)
- stagedUploadsCreate → POST → fileCreate
- fileCreate from a public URL
- fileStatus: UPLOADED, READY, FAILED + fileErrors
- Add / remove product images with fileUpdate
- fileDelete
💻 Free source code for this episode: https://github.com/fayyaz315/shopify-app-development-2026/tree/ep10
3 quick fixes from this episode
Shopify GraphQL Upload File: The 3 Steps (stagedUploadsCreate + fileCreate)
Shopify GraphQL upload file (2026-10): you can't send the bytes to fileCreate. Step 1 stagedUploadsCreate gives a signed URL and form fields, step 2 POST the file there (201), step 3 fileCreate with the resourceUrl - and the image is READY seconds later. Tested on a real store.
▶ 60-second video: https://youtube.com/shorts/wcaEunoj--0
Shopify File Create Failed? fileStatus, fileErrors & the Real Reason
Shopify file create (2026-10): fileCreate answers right away with status UPLOADED and no errors - the real result comes later. A broken image URL turns FAILED with fileErrors: 'Media processing failed', and the details say the file returned 404. Poll fileStatus until READY or FAILED.
▶ 60-second video: https://youtube.com/shorts/9BDfR9OCi3Y
Shopify Admin API Upload File to a Product: fileUpdate referencesToAdd
Shopify admin API upload file to a product (2026-10): once a file is READY, one fileUpdate with referencesToAdd and the product's ID adds it to the product's media - same image, no copy. referencesToRemove takes it off the product, and the file stays in Files.
▶ 60-second video: https://youtube.com/shorts/tJlfJbl1nPM
Step by step
Preview + intro (0:00)
In the next ten minutes, your app uploads an image to Shopify, and puts it on a product. You'll add a photo straight from a URL, and see exactly why a broken one fails. This is the Shopify file upload API at work.
Our app uploaded this photo, and put it on the product, without opening Shopify's editor. This is episode ten of the Shopify app development series. Last time, webhooks.
Today: files and media. The full code is free on GitHub, and the link is in the description.
Files vs product media (0:33)
First, two words that get mixed up: files, and product media. Files is the store's library, under Content, Files in the admin. Every image you upload lands there.
Merchants find it under Content, Files. Product photos, theme images and documents all live there. Product media is the images on one product.
Good uses: import product photos from a supplier, upload size charts, or let merchants pick images from your own app. And it's the same image. In my tests, the product's media had the exact same ID as the file.
So you upload once, then point products at it.
The write_files scope (1:13)
This episode needs one new permission: write files. Before I added it, the files query and file create both came back access denied, and the error named the scopes that would work. Oddly, stagedUploadsCreate worked without it.
You can get an upload target, but you can't turn it into a file. After changing scopes, I restarted the dev server and opened the app once, and Shopify granted the new scope.
The Files page (1:39)
Now the new Files and media page. Upload from your computer on the left, add from a URL on the right. Below, the latest images in the store, a product picker, and buttons to add, remove or delete.
A new page is a new file. The route app.files becomes/app/files. The loader asks for the six newest images, with their status, any errors, and the image size.
Plus ten products with their media count. The query filter media type image skips videos and other files, and sortKey createdAt, reversed, puts the newest first. For each file the loader keeps the ID, the alt text, the status, the image URL and size, and the first error if there is one.
Each node in that list is a media image here. Generic files and videos come back as other types, so you pick their fields with on.
Upload in three steps (2:38)
Here's why uploading takes three steps. Shopify's GraphQL API doesn't take the bytes of a file. You send it somewhere first.
Step one, stagedUploadsCreate. You tell Shopify the file name, the type, the size, and that it's an image. The file size goes in as a string.
Big numbers travel through GraphQL as text. Shopify answers with a URL, a resource URL, and a list of parameters. In my test, the URL was a Google Cloud Storage bucket, with signed parameters.
Step two: post the file there, as a form. Every parameter first, in order, and the file last. The storage answers two oh one, created.
Nothing exists in the store yet. Step three, file create, with the resource URL as the original source. Now it's a file in the store.
If the post to storage fails, we stop and show the status code. File create never runs, so nothing half done lands in the store. Alt text is what screen readers say, and what search engines read.
If you leave it empty, our app uses the file name. In our app the browser sends the file to our own server action, and the server does all three steps. The page just submits a form.
The choose image button clicks a hidden file input, and the page keeps the picked file, so it can show its name and size.
Live: upload (4:03)
Let's do it. Choose image, a size chart for the Everyday Crew Neck Tee, and an alt text. Upload.
The round trip, our server, the storage, and file create, took about five seconds. It's in the list, processing. And a moment later, ready, twelve hundred by twelve hundred.
That's because file create answers right away, with status uploaded. Shopify processes the image after that. So the page re-reads the list every second and a half, but only while a file is still uploaded or processing.
The badge colours follow the status: green when ready, red when failed, blue while it's uploaded or processing. And our page disables add and remove until a file is ready.
From a URL (4:50)
The second way needs no upload at all. Add from a URL: a public photo of a white crew neck tee. Alt text, and add from URL.
Shopify downloads it for us. Ready, a few seconds later. In the code, it's file create alone, with the URL as the original source.
No staged upload. Coming up: a URL that file create happily accepts, and that still fails. The file keeps the name from the URL.
In GraphiQL later, you'll see pexels photo, then the number.
When it fails (5:24)
Now a URL that doesn't exist. File create still says OK. No userErrors at all.
Then the status turns failed. And file errors tells us why: the file does not exist, response code four oh four. That's the trap.
A userErrors check is not enough. Read file status, and file errors, after processing. File errors has a code, a message, and details.
The message only said media processing failed. The details had the real reason. Some problems do fail right away.
In GraphiQL, file create with the original source, hello. Image URL is invalid. That's a user error, because Shopify can see it before downloading anything.
Add to a product (6:09)
Now let's use an image. I pick the Everyday Crew Neck Tee. One image so far.
Add to product, on the tee photo. Added to the product, and the badge says two images. That's file update, with referencesToAdd, and the product's ID.
No productUpdate, no copy of the image. The product picker is a normal select, and the badge counts the product's media from the loader. The proof, on Shopify's own product page.
Media: the original photo, and ours, right next to it.
Remove and delete (6:49)
Back in the app. Remove does the opposite. Removed from the product.
One image again. referencesToRemove takes it off the product, but the file stays in Files. In my test, the same file was still there, ready.
And delete removes the file itself. I delete the failed one. File deleted.
File delete takes a list of IDs. Run it twice, and the second time says file does not exist.
Read files in GraphiQL (7:20)
To read files yourself, here's the files query in GraphiQL. The newest three, with alt text, status, and image. Our two images, both ready, on Shopify's CDN.
One named pexels photo, one named size chart tee.
Honest notes (7:36)
A few honest notes before the recap. One: our file goes through our own server. For big files, send it from the browser straight to the staged URL instead.
Two: the failed upload kept the alt text from the photo before it, because I didn't clear the field. Clear your form after each add. Three: we only handle images.
Videos and 3D models use the same staged upload idea, with a different resource type. Want to practise? Add an edit alt text button.
File update takes an alt, and it's good for accessibility and SEO. And everything you saw was tested on my real development store, on API version 2026-10, before I pressed record.
Recap (8:25)
So, the recap. Add the write files scope. Upload in three steps: stagedUploadsCreate, post the bytes, file create.
Or file create alone with a public URL. Wait for ready, and read file errors when it fails. Then put the file on products with file update and referencesToAdd.
That's the Shopify file upload API in 2026, inside a real app, on a real store. The full code for this episode is free on GitHub. The link is in the description.
Next episode: online store content. Pages, blog posts and menus, from your own app. See you there.
📖 The full written tutorial with every episode: https://www.wixob.com/shopify-file-upload-api-tutorial/
📚 Course page: https://www.wixob.com/shopify-app-development-2026/
🔔 New episodes on YouTube: https://www.youtube.com/@fayyaz-ahmed-shopify-developer?sub_confirmation=1
Questions about the Shopify GraphQL Admin API? Ask in the comments — I answer every one.