Upload Native

Line-item property vs cart attribute for customer file uploads

Updated Dec 2, 2026 Any plan 4 min read

Short answer: A line-item property belongs to one product on the order, and a cart attribute belongs to the whole order. With the Auto setting, the product page writes a line-item property, while the cart page and checkout write a cart attribute. Both carry the file URL and file ID.

What is the difference between the two?

Shopify gives a cart two places to keep extra information from a customer.

  • A line-item property is attached to one product line, for example “Engraving text” on a pen. If the same cart has two pens, each line can hold a different value.
  • A cart attribute is attached to the cart as a whole, for example a delivery note. It does not belong to any product.

Shopify carries both onto the order when it is created. Upload Native uses both, because the right choice depends on whether the file describes an item or the order.

Which upload surface writes which?

With the block’s “Where to attach the file” setting left on Auto, which is the recommended default:

Where the customer uploadsWritten asKeys
Product pageLine-item propertyUploaded file (URL), _upload_reference_ids (File ID)
Cart pageCart attributeupload_reference (URL), upload_reference_ids (File ID)
Checkout (Shopify Plus)Cart attributeupload_reference (URL), upload_reference_ids (File ID)

Auto looks for a product form. If the block sits on a product page and finds the add-to-cart form, it adds hidden inputs to that form, so the native add-to-cart carries the file with the item. On the cart page there is no product form, so it writes the cart attribute instead. Checkout always writes the cart attribute.

How do I hide the file from customers?

For line-item properties, turn on “Hide the file from cart and checkout” in the block. The URL property is then saved with an underscore prefix, as _Uploaded file. Shopify’s documentation says a leading underscore hides a property from customers at checkout, while it stays on the order for you.

The File ID property already starts with an underscore, so it is hidden by default.

This setting applies only to line-item mode. Cart attributes have no hiding rule, so a cart attribute is visible wherever the theme or checkout prints attributes.

How are several files stored?

Both keys hold a string. With one file, the string is the value itself. With several files, the string is a JSON array, kept in the same order for the URLs and the IDs.

["https://cdn.shopify.com/s/files/1/0000/proof-a.pdf","https://cdn.shopify.com/s/files/1/0000/proof-b.pdf"]

Parse it in code before using it. A template that prints the raw value will show the brackets and quotes. The upload limit per block is the “Max files (when multiple)” setting.

Can I choose my own key name?

Yes. On the theme block and on the checkout block, the attribute name setting lets you replace upload_reference with your own key. The File IDs then use that name plus _ids. In line-item mode the ID key is the name with a leading underscore, so a custom name of artwork gives _artwork_ids.

Use a custom name when another system already expects a specific key, or when two blocks on one page need to stay apart.

How do I choose between them?

Ask what the file is for.

  1. The file belongs to a product. Use a line-item property. Personalized, printed, engraved and made-to-order items are the usual cases.
  2. The file belongs to the order. Use a cart attribute. A single brief, a logo for the whole shipment, or a document that applies to everything fits here.
  3. You are on Plus and want it before payment. Use checkout, which writes a cart attribute.
  4. You need a required file. The “required before checkout” check reads the cart attribute. A file stored as a line-item property from a product page does not count toward it.

That last point is worth planning around. If you need to make the file required, use a cart attribute, or ask customers to upload at checkout.

How do my scripts and templates read them?

Cart attributes read as attributes.upload_reference in notification templates, and as customAttributes on an order in the Admin API. Line-item properties read as line.properties in templates, and as customAttributes on each line item in the API. The order guide has the exact query, and the developer docs cover the storefront side, including writing the attribute yourself.

FAQ

Which one should I choose for personalized products?
A line-item property. Two different engraved items in one order each keep their own file, so production never has to guess which artwork belongs to which product.
Can I force one type regardless of the page?
Yes. Set 'Where to attach the file' on the theme block to Line-item property or Cart attribute instead of Auto. On a page with no product form, line-item mode falls back to the cart attribute.
Do the names ever change?
Yes. A custom name in the block settings replaces upload_reference. When a page has several blocks and the name is blank, extra blocks use upload_reference_2, upload_reference_3 and so on.
Does the app edit the order?
No. It sets a property or attribute on the cart. Shopify copies it onto the order when the customer pays.

Add file uploads to your store

Install free. Files save to your own Shopify Files.

Install the app