How do I update properties on a shopify line_item

独自空忆成欢 提交于 2019-12-10 03:14:14

问题


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.



来源:https://stackoverflow.com/questions/36351913/how-do-i-update-properties-on-a-shopify-line-item

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!