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 uploads | Written as | Keys |
|---|---|---|
| Product page | Line-item property | Uploaded file (URL), _upload_reference_ids (File ID) |
| Cart page | Cart attribute | upload_reference (URL), upload_reference_ids (File ID) |
| Checkout (Shopify Plus) | Cart attribute | upload_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.
- The file belongs to a product. Use a line-item property. Personalized, printed, engraved and made-to-order items are the usual cases.
- 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.
- You are on Plus and want it before payment. Use checkout, which writes a cart attribute.
- 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.