Ad

How Do I Update Properties On A Shopify Line_item

- 1 answer

How do I update the properties for a specific line_item using the shopify api?

There does not seem to be a method to directly update a specific line item.

I then tried to update the entire order object instead, but it seems like it is not saving my properties. If I save the order with the following json, the api returns the full order object, but with an empty properties [] line for my line_items.

{"order":{"id":94202342,"line_items":[{"id":615546756,"variant_id":627937216,"properties":[{"my_test_key":"This_is_a_test"}]}]}}
Ad

Answer

You can create a new order with the API but you can't update the line items of an existing order.

From the Order API docs:

You should also note that you can change only a few of an order's attributes using the API. You cannot change the items or the quantities in an order.

Ad
source: stackoverflow.com
Ad