Updating Order Line Item

Topic summary

A developer is attempting to update line item custom attributes on existing Shopify orders using Flow’s Admin API but encountering errors. They can successfully update order-level custom attributes using the orderUpdate mutation, but adding lineItemId to the input fails with “Field is not defined on OrderInput.”

Key limitation identified: Shopify’s Admin API does not support updating line item properties on existing orders—only order-level modifications are permitted.

Proposed workarounds:

  • Use Draft Orders for pre-checkout editing
  • Refund and recreate orders to modify line items
  • Store additional data in metafields instead

Context: The implementation involves a custom “build-a-box” subscription product built on Shopify 1.0, where customers select multiple attributes (up to 7) added as line item custom attributes. The developer needs admin-editable line items for subscription management but faces compatibility issues with the legacy custom basket implementation. Rebuilding to use metafields would require significant refactoring of the existing codebase.

Status: The discussion remains open with no clear solution for editing line items on existing subscription orders without major architectural changes.

Summarized with AI on October 29. AI used: claude-sonnet-4-5-20250929.

Hi, wonder if anyone can help.

I can update Order Custom Attributes, but I’m stuck on line items.

In the orders screen I have

I can update 1, but not 2.

In 1 I am using
Send Admin API request
orderUpdate

{
	"input": {
  "id": "gid://shopify/Order/116544546654200",
		"customAttributes": [
			{
				"key": "Essences",
				"value": "Apple, Walnut, Peach"
			}
		]
	}
}

This works on 1.

I have tried adding after the ID, the following
“lineItemId”: “gid://shopify/LineItem/348823433194936”,

But I get the following error

Mutation had errors: “Variable $input of type OrderInput! was provided invalid value for lineItemId (Field is not defined on OrderInput)”

What is it I am missing?

Is there any good tutorials on the basic of using Flow for this type adjustment.

kind regards

1 Like

You can’t update line item properties in an existing order using the Admin API. Shopify only allows order-level updates.

Workarounds

FirstlyUse Draft Orders – Edit before checkout.

Then,Refund & Recreate – Only way to fully change line items.

Also Use Metafields – Store extra info instead of editing the line item.

Let me know if you need help with a workaround

That is a bit of a bummer.

1. FirstlyUse Draft Orders – Edit before checkout.
This is for Shopify subscription orders, so if they want to edit their line items for next time, by the admin able to edit the order line items I thought it’d be able to edit it for next subscription run. I really don’t fancy recreating the order as a draft, etc

2. Also Use Metafields

This would probs take a bit rebuild, it was built in Shopify 1 a few years ago and doesn’t use the standard basket. It is a custom build a box, so people can add different attributes (upto 7) to a single order and then checkout.
These are added to a Orders Line Items Custom Attributes.

eg:

if (Shopify.queue.length) {
                    var request = Shopify.queue.shift();
                    var data = {};
                    if (request.properties) {
                        data = {
                            id: request.variantId,
                            quantity: request.quantity,
                            selling_plan: choosenFrequency,
                            properties: {
                                Essences: essenceString,
                                Price: '£' + boxPrice.toFixed(2),
                                'Base': choosenBase
                            }
                        };

So would need to rebuild
It originally came from:

https://www.slicedbread.agency/blogs/shopify/how-to-develop-a-build-a-box-product-in-shopify
But now customer is investigating Subscriptions and this type of custom basket is not the most compatible if you want to edit subscriptions