# How to get a customer's uploaded file from a Shopify order

> Open the order and look for the upload_reference value, which holds the file's URL. Product page uploads sit on the line item and cart or checkout uploads sit on the order. Developers can read the same values with the Admin API, or load the file in Shopify Flow.

## Where is the uploaded file on a Shopify order?

Every upload is saved to your own Shopify Files. What reaches the order is a reference to that file, not the file itself. The reference arrives in one of two places, depending on where the customer uploaded.

- **Product page uploads** become a line-item property named `Uploaded file` that holds the file URL, plus a hidden property named `_upload_reference_ids` that holds the Shopify File ID. They show on the line item the customer was buying.
- **Cart page and checkout uploads** become a cart attribute named `upload_reference` (the URL) plus `upload_reference_ids` (the File ID). Shopify copies cart attributes onto the order when it is created.

If you changed the attribute name in the block settings, look for your name instead. If the block hides the property from shoppers, the property name starts with an underscore, for example `_Uploaded file`. It stays on the order.

In the admin, open the order. Upload Native's own setup guide points to the Additional details area of the order page for cart attributes, and to the line item for the product page property. The file itself is also listed under Content, then Files.

## How do I open the file from the order?

The URL is a plain link to the file in Shopify Files. Copy it into a browser tab to view or download it. If the order has several files, the value is a JSON array of URLs rather than a single link, so you will see square brackets and quotes around the addresses.

For a handful of orders this is all you need. For a print shop or an engraving workflow where every order has a file, you will want to read the values automatically, which the next sections cover.

## How do I read the upload with the Admin API?

This query returns the order name, the cart attributes, and the properties on up to 50 line items. It needs the `read_orders` scope.

```graphql
query OrderUploads($id: ID!) {
  order(id: $id) {
    name
    customAttributes {
      key
      value
    }
    lineItems(first: 50) {
      nodes {
        title
        customAttributes {
          key
          value
        }
      }
    }
  }
}
```

Pass the order's global ID as the variable, for example `{"id": "gid://shopify/Order/1234567890"}`. In the result, look for entries whose `key` is `upload_reference` or `upload_reference_ids` in the order's `customAttributes`, and `Uploaded file` or `_upload_reference_ids` in each line item's `customAttributes`.

Both fields return strings. When a block allows several files, the string is a JSON array, so run it through `JSON.parse` before using it.

## How do I get the file's details from its ID?

The File ID, which looks like `gid://shopify/GenericFile/123`, lets you ask Shopify about the stored file. This query needs the `read_files` scope.

```graphql
query UploadedFile($id: ID!) {
  node(id: $id) {
    ... on GenericFile {
      url
      mimeType
      originalFileSize
      fileStatus
    }
    ... on MediaImage {
      mimeType
      image {
        url
        width
        height
      }
    }
  }
}
```

PDFs and other documents come back as a `GenericFile`. Pictures come back as a `MediaImage`, where the URL sits under `image`. Check `fileStatus` before you link to the file, since a file that has only just been uploaded can still be processing.

Both queries were checked against Admin API 2026-04. If you use a later version, check the field names again before you ship.

## Can Shopify Flow load the file for me?

Yes. The Upload Native "Load file details" action takes a File ID or an exact filename and returns the filename, MIME type, size in bytes, and the original URL. For images it also returns small, medium and large versions. You can place it in any workflow, then pass the URL to an email step or another app. The [Flow guide](/guides/shopify-flow-file-uploaded/) walks through a full example.

## What should I check when the value is missing?

- Confirm the customer uploaded before they paid. The value is set on the cart, so a file added after the order was created is not carried over.
- On the product page, check the block's "Where to attach the file" setting. Auto uses a line-item property there.
- Check whether you set a custom attribute name. The default is `upload_reference`, and extra blocks on the same page use `upload_reference_2` and so on.
- Look at the app's Uploads list in the admin. If the file is listed there but missing from the order, the cart value was probably cleared or overwritten by another app or theme script.

## FAQ

### Why does the order show a link instead of a preview?

Shopify stores the value exactly as the storefront sent it, so you see the file URL as text. Open the URL in a new tab, or use the file ID to read the file from Shopify Files.

### What do I do when upload_reference_ids holds a list?

A block that allows several files saves its values as a JSON array. Parse the array first, then pass each ID to the file query one at a time.

### Can the app write the file onto the order for me?

No. Upload Native never edits the order. It only sets the cart attribute or line-item property, and Shopify carries that onto the order when the customer pays.

### Which API scopes do these queries need?

Reading the order needs read_orders. Reading the file needs read_files. A custom app you create in your own store can be granted both.

Canonical URL: https://uploadnative.app/guides/get-uploaded-file-from-shopify-order/
