Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/312.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 限制Shopify产品/更新webhook的变量字段_Python_Shopify_Webhooks - Fatal编程技术网

Python 限制Shopify产品/更新webhook的变量字段

Python 限制Shopify产品/更新webhook的变量字段,python,shopify,webhooks,Python,Shopify,Webhooks,如何限制webhook为Shopify的产品/更新webhook发送的字段 当我创建webhook时,我可以发送如下字段,但是如何限制变量列表中的字段 new_webhook = shopify.Webhook() new_webhook.topic = 'product/update' new_webhook.fields = ["id","title","variants","updated_at"] new_webhook.save() 下面是示例响应(带有上述字段)。我所关心的变量对象

如何限制webhook为Shopify的产品/更新webhook发送的字段

当我创建webhook时,我可以发送如下字段,但是如何限制变量列表中的字段

new_webhook = shopify.Webhook()
new_webhook.topic = 'product/update'
new_webhook.fields = ["id","title","variants","updated_at"]
new_webhook.save()
下面是示例响应(带有上述字段)。我所关心的变量对象是“id”、“title”、“sku”和“updated_at”(即我不需要所有其他数据):


请求产品数据时,不能限制返回的变量字段。

Ah bummer,OK。谢谢你,大卫。
{
  "id": 327475578523353102,
  "title": "Example T-Shirt",
  "updated_at": null,
  "variants": [
    {
      "id": 1234567,
      "product_id": 327475578523353102,
      "title": "",
      "price": "19.99",
      "sku": "example-shirt-s",
      "position": 0,
      "grams": 200,
      "inventory_policy": "deny",
      "compare_at_price": "24.99",
      "fulfillment_service": "manual",
      "inventory_management": null,
      "option1": "Small",
      "option2": null,
      "option3": null,
      "created_at": null,
      "updated_at": null,
      "taxable": true,
      "barcode": null,
      "image_id": null,
      "inventory_quantity": 75,
      "weight": 0.44,
      "weight_unit": "lb",
      "old_inventory_quantity": 75,
      "requires_shipping": true
    },
    {
      "id": 1234568,
      "product_id": 327475578523353102,
      "title": "",
      "price": "19.99",
      "sku": "example-shirt-m",
      "position": 0,
      "grams": 200,
      "inventory_policy": "deny",
      "compare_at_price": "24.99",
      "fulfillment_service": "manual",
      "inventory_management": "shopify",
      "option1": "Medium",
      "option2": null,
      "option3": null,
      "created_at": null,
      "updated_at": null,
      "taxable": true,
      "barcode": null,
      "image_id": null,
      "inventory_quantity": 50,
      "weight": 0.44,
      "weight_unit": "lb",
      "old_inventory_quantity": 50,
      "requires_shipping": true
    }
  ]
}