2017-01-28 13 views
0

Как ограничить поля, которые webhooks отправляют на сайт Shopup's product/update 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() 

Образец ответа (с приведенными выше полями) приведен ниже. Все, что я забочусь о от варианта объектов «идентификатор», «название», «ы» и «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 
    } 
    ] 
} 

ответ

1

Вы можете не ограничивать возвращаемые варианты, когда вы запрашиваете данные о продуктах.

+0

Ах облом, хорошо. Спасибо Дэвиду. – cj1689262