如何更新 shopify line_item 的属性 [英] How do I update properties on a shopify line_item

查看:67
本文介绍了如何更新 shopify line_item 的属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 shopify api 更新特定 line_item 的属性?

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.

然后我尝试更新整个订单对象,但它似乎没有保存我的属性.如果我使用以下 json 保存订单,api 将返回完整的订单对象,但我的 line_items 有一个空的 properties [] 行.

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

推荐答案

您可以使用 API 创建新订单,但不能更新现有订单的订单项.

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

来自 Order API 文档:

您还应该注意,您只能更改订单中的几个使用 API 的属性.您不能更改项目或订单中的数量.

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.

这篇关于如何更新 shopify line_item 的属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆