Setting a Custom Webhook Endpoint API Version Using Stripe's API
Turns out you can't set a custom webhook API version through Stripe's web UI as of Nov 2020, but here's how to do it through their API.
If you use Stripe’s API, chances are you’ll want to make sure your Stripe webhooks use the same API version as what you configured your app to use. That’ll ensure you won’t get backwards incompatible changes between both versions.
This recently came up in my Build a SAAS App With Flask course (which I just updated) so I figured I’d make a video about how it was addressed.
# Demo Video
Timestamps
- 0:28 – Not able to select specific webhook endpoint API versions with Stripe’s web UI
- 1:54 – Using Stripe’s webhook endpoint API to set a custom API version
- 2:51 – Breaking down and editing the curl command to work for our application
- 6:17 – Running the curl command to create the webhook endpoint using Stripe’s API
- 6:54 – Testing it out by creating a subscription in a Flask app that uses Stripe
- 7:53 – I wonder why the webhook API version isn’t tied into your app’s API version
Reference Links
Did you end up doing this? Let me know below.