How do I update properties on a shopify line_item

2019-04-23 02:16发布

问题:

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"}]}]}}

回答1:

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.



标签: api shopify