I’m trying to modify attributes for individual line items using Shopify’s API but running into issues.
It looks like there’s no direct way to edit just one line item by itself. So I thought maybe I could update the whole order instead, but that’s not working either. When I send my request, the API gives me back the complete order data but the attributes field shows up empty.
Been wrestling with this for years too. Shopify locks down line item properties once orders move past pending - that’s your main problem. Your JSON format looks fine, so it’s likely a timing thing. Properties show up empty when you try updating orders that are already processed or paid. I always check financial_status and fulfillment_status first - both need to be early stage for updates to work. Also, some Shopify Plus stores have extra restrictions on line item changes that aren’t documented anywhere. Test it on a fresh unpaid order first to see if it’s your format or just status restrictions.
had this exact problem last week. you’re probably hitting a read-only endpoint - make sure you’re using PUT, not GET. Shopify’s picky about line item updates. you need to include ALL existing line items in your request, even when you’re only changing one. leave anything out and Shopify deletes it. include the full order structure with all line items, then modify what you need. took me hours to figure this out lol
Had the same frustration a few months back when trying to update line item properties. Your JSON structure’s wrong - you’re using an object when Shopify expects key-value pairs. Instead of “properties”: [{“custom_field”: “sample_value_here”}], use “properties”: [{“name”: “custom_field”, “value”: “sample_value_here”}]. Each property needs both name and value fields. Also, you can only modify properties on unfulfilled orders. If the order’s past a certain status, the API accepts your request but won’t actually update anything - that’s probably why you’re getting successful responses with empty properties. Check your order status in admin before making the API call.
The manual API wrestling everyone’s talking about is exactly why I quit doing this by hand years ago. Shopify’s line item API is genuinely painful - all those gotchas with order status, property formats, and needing complete payloads.
Automation that handles the edge cases works way better. I use Latenode for Shopify integrations because it already knows Shopify’s quirks.
You can build a workflow that checks order status first, formats properties correctly, pulls full order data, updates what you need, and sends it back properly formatted. Takes 10 minutes to set up versus hours debugging API calls.
When Shopify changes their API again, you just update the workflow instead of rewriting code from scratch.
Yeah, this tripped me up too when I first ran into it. Line item properties work weird compared to other Shopify API endpoints. You can’t just update them after the order’s created - they’re basically locked in during order creation. I ended up using the Order API’s note_attributes instead when I needed custom data post-creation. Way easier. If you really need line-item-specific stuff, you’ll probably have to hack it with metafields at the order level and tie them to line item IDs. Also check your API version in the headers - older versions handle properties differently. Something changed around 2021-01, so make sure you’re using the version that matches the docs for whatever structure you’re trying to use.