Webhook notification

curl

#1

Hello everyone :smile:

A few weeks ago, I’ve noticed that my webhook URL is not notified when I update a product from the dashboard UI.
Here’s my integrations :

GET https://api.moltin.com/v2/integrations took: 618ms
{"data":[{"id":"a8770601-1060-4687-a5dd-bc920d8812ad","type":"integration","integration_type":"webhook","name":"Product events should notify hyperbolyk.com","description":null,"enabled":true,"configuration":{"url":"https://v2.hyperbolyk.com/api/moltin/notify-product","secret_key":"JkiRShJYzf4JhNptzfvORbYEqhP3DDQTk7EAxViZr7Q="},"observes":["product.created","product.updated","product.deleted"],"links":{"self":"https://api.moltin.com/v2/integrations/a8770601-1060-4687-a5dd-bc920d8812ad"},"meta":{"timestamps":{"created_at":"2018-06-21T07:28:26.901Z","updated_at":"2018-06-21T07:28:26.901Z"}}}]}

As you can see, I’ve defined a product.created, product.updated and product.deleted in observes.
Please note that when I create or delete a product from the dashboard UI, my webhook is actually notified but not when I update a product.

Also when I delete a product the payload is:

{"id":"0cbc10d5-6483-4af7-9bb1-c7215c2918d2","triggered_by":"product.deleted","attempt":1,"integration":{"id":"a8770601-1060-4687-a5dd-bc920d8812ad","integration_type":"webhook","name":"Product events should notify hyperbolyk.com"},"resources":"{\"errors\":[{\"status\":404,\"detail\":\"The requested product could not be found\",\"title\":\"Product not found\"}]}"}

This payload is really unhelpful because there’s no way to know which product has been deleted. In my opinion, I think that the product.deleted event should at least contain the product id otherwise it’s pretty much useless :slightly_frowning_face:

Thanks for your help!
Guillaume


#2

Hi @ggrossetie

This is a great observation. I’ll bring this up with the engineering team and flag it for review.

Apologies for the inconvenience caused. I’ll get back to you when this has been resolved, for now, you could silently handle deleting products by marking them as draft and storing a custom field for deleted_at which means you could subscribe to product.updated and check for that status change.

I hope this helps :smile:


#3

Thanks for you quick reply!

That’s a good idea but since my webhook is not notified when a product.updated event is fired it won’t work :disappointed:


#4

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.