【发布时间】:2016-04-01 08:50:22
【问题描述】:
如何使用 shopify api 更新特定 line_item 的属性?
似乎没有直接更新特定订单项的方法。
然后我尝试更新整个订单对象,但它似乎没有保存我的属性。如果我使用以下 json 保存订单,api 返回完整的订单对象,但我的 line_items 有一个空的 properties [] 行。
{"order":{"id":94202342,"line_items":[{"id":615546756,"variant_id":627937216,"properties":[{"my_test_key":"This_is_a_test"}]}]}}
【问题讨论】:
-
来自 Shopify 文档:
Change an order’s attributes such as note, email, buyer-accepts-marketing, or remove the customer association。恐怕您无法更改订单中的其他任何内容。 -
短语“例如”应该表明它只是您可以更改的示例。不是整个列表。
-
您可以在docs.shopify.com/api/reference/order 查看他们关于订单 API 的文档,并在我的声明中纠正我。我很高兴知道它是否成功。