You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 2, 2024. It is now read-only.
retrieve, update and delete webhooks for a Shippo account programmatically. The same functionality is already exposed in the Shippo dashboard at https://app.goshippo.com/api/.
379
+
380
+
To add both a webhook and track a url at the same see the shippo.Track.create function.
381
+
"""
382
+
383
+
@classmethod
384
+
defclass_url(cls):
385
+
cls_name=cls.class_name()
386
+
return"v1/%ss/"% (cls_name,)
387
+
388
+
@classmethod
389
+
deflist_webhooks(cls, api_key=None, **params):
390
+
"""List all the webhooks associated with the account"""
391
+
returnsuper(Webhook, cls).all(api_key, **params)
392
+
393
+
@classmethod
394
+
defcreate(cls, api_key=None, **params):
395
+
"""Create a Webhook to push events from Shippo (i.e tracking,transations)
396
+
397
+
Arguments:
398
+
**params
399
+
url (str) -- url of your webhook (make sure it is not behind basic auth.
400
+
endpoint must return 200 when it receives a POST
401
+
event (str) -- any valid webhook event as listed here https://goshippo.com/docs/webhooks.
402
+
is_test (str) -- set the webhook object to test or live mode
403
+
Keyword Arguments:
404
+
api_key (str) -- an api key, if not specified here it will default to the key
405
+
set in your environment var or by shippo.api_key = "..."
0 commit comments