We discovered yesterday that when creating a Shopify webhook using the api, the specified webhook format is being ignored.
For example:
>>> hook = shopify.Webhook()
>>> hook.topic = 'products/update'
>>> hook.address = '<REDACTED>'
>>> hook.format = 'json'
>>> hook.save()
True
>>> shopify.Webhook.find()
[webhook(2302062)]
>>> shopify.Webhook.get(2302062)
{'format': 'xml', 'created_at': datetime.datetime(2012, 11, 29, 12, 30, 55, tzinfo=tzutc()), 'updated_at': datetime.datetime(2012, 11, 29, 12, 30, 55, tzinfo=tzutc()), 'topic': 'products/update', 'address': '<REDACTED>', 'id': 2302062}
In the example above we try to set the webhook format to ‘json’, but the webhook is created with a format of ‘xml’
This has previously been working. Yesterday was the first occurrence we’ve seen of this problem.
Webhooks created through the web admin interface still correctly allow the format to be specified as json, however the web admin interface doesn’t show any webhooks created through the api, nor vice-versa.
This was a bug in shopify_python_api where format was being set on the class rather than on the resource attribute. I have just fixed this and released shopify_python_api in version 1.0.3, so the problem should go away after upgrading.