Implementing Paddle webhooks with Django?

Hello,

anyone with experience implementing Paddle platform in their Django app?

I have successfully integrated the Checkout part and now need the webhooks.

I am struggling grasping how the webhook payload looks like. On this page, there are mentions about subscription_id. But the webhooks reference doesn’t have this field.

I am aware of a package for paddle, but it seems a bit abandoned with little activity - hence I would like to implement this myself.

Can’t say I have used Paddle, but I can empathize. Webhook docs are often patchy.

I wrote a post on writing webhook receivers, which covers creating a model to log responses: How to Build a Webhook Receiver in Django - Adam Johnson . Perhaps that can help you debug.

FYI I can see subscription_id, by scrolling down within the box of fields (bad design).

1 Like

I think I need to take a break :man_facepalming: I completely missed the scroll-bar. I thought since it is like a 1/2 of the page that there are no more data…

Does it make sense to also store the entire request body alongside the properties I need? Just to be sure.

Another thing that scares me a bit is webhook verification. The Python example looks quite intimidating. import phpserialize :face_with_spiral_eyes:

Are there other standardized ways to verify webhooks? The verification in your blog posts looks much simpler and actually makes sense to me

I like it for debugging purposes, but if the data is too much then it could be worth trimming it down.

There’s no webhook standard, it’s just whatever the provider decides. Yes use of phpserialize looks unfortunate. The library is also very unmaintained, no commits since 2016: GitHub - mitsuhiko/phpserialize: A PHP serializer implementation for Python :frowning: