3 ms·
Their API is good but I hope they let you configure webhook API versions from their UI or even tie them into the API version used to trigger the webhook because
by nickjj 6y ago
Their API is good but I hope they let you configure webhook API versions from their UI or even tie them into the API version used to trigger the webhook because webhooks do not respect the API version you used to call an API endpoint that triggered the webhook at the moment.
It will use the API version you defined when you created the webhook endpoint, but the UI to create the webhook endpoint also doesn't let you pick a specific API version. It will use their latest API version.
It's really non-intuitive because it means you have to set webhook endpoints using Stripe's API because only then the API version is configurable, but it also makes deploying Stripe API changes kind of complicated because you need to create multiple webhook endpoints in parallel to not throw exceptions due to your code expecting webhooks with different properties based on API differences.
I emailed Stripe about this once and support had to forward the request to someone higher up but ultimately my feedback got put into the "Dear valued customer, thanks for the feedback" bucket which means nothing will probably come of it.
I wish I knew the technical details on why webhooks aren't sent using the same API version that was used to call the API endpoint that triggered it. Stripe engineers are a lot smarter than me and I can't imagine they didn't think of this already. Is there a technical limitation or downside to this strategy?
- Androider 6y agoYou can have multiple clients at different API versions interacting with Stripe, with a single webhook in your service to receive the callback. Even if you had a single integration, you cannot usually guarantee an atomic switch to the newer API version across all servers, so you either have separate versioned endpoints or your webhook endpoint has to deal with multiple versions. That said, I do agree you should be able to specify the exact version for a webhook in the Stripe admin UI. But I also wouldn't worry about trying to track the versions too much, Stripe is great in that your integration from 5 years ago will still work just fine today unless you need the newer payment methods.
- boucher 6y agoThe simplest answer is probably that events aren't really generated in a one-to-one relationship with API calls, so it's very non obvious at that point what behavior you would expect. I believe the logic behind associating the current API version with the endpoint you are adding is that you are adding it now so you should use the current API. Perhaps they should let you choose an older version, but there's always some desire to get people to upgrade to the latest version of things.