限制 Shopify product/update webhook 的变体字段
Limit variant fields for Shopify product/update webhook
我如何限制 webhook 为 Shopify 的 product/update webhook 发送的字段?
我可以在创建 webhook 时发送如下字段,但我如何限制变体列表中的字段?
new_webhook = shopify.Webhook()
new_webhook.topic = 'product/update'
new_webhook.fields = ["id","title","variants","updated_at"]
new_webhook.save()
示例响应(包含上述字段)如下。 variant 对象我只关心 'id'、'title'、'sku' 和 'updated_at'(即我不需要所有其他数据):
{
"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
}
]
}
您不能限制请求产品数据时返回的变体字段。
我如何限制 webhook 为 Shopify 的 product/update webhook 发送的字段?
我可以在创建 webhook 时发送如下字段,但我如何限制变体列表中的字段?
new_webhook = shopify.Webhook()
new_webhook.topic = 'product/update'
new_webhook.fields = ["id","title","variants","updated_at"]
new_webhook.save()
示例响应(包含上述字段)如下。 variant 对象我只关心 'id'、'title'、'sku' 和 'updated_at'(即我不需要所有其他数据):
{
"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
}
]
}
您不能限制请求产品数据时返回的变体字段。