What are the / v1 / for URLs in Stripe API URLs?

The Stripe API documentation for versions says:

When we make backward incompatible API changes, we release new obsolete versions. The current version is 2014-12-08.

It provides an example of access to the charge API for a specific version:

 curl https://api.stripe.com/v1/charges \ -u sk_test_BQokikJOvBiI2HlWgH4olfQ2: \ -H "Stripe-Version: 2014-12-08 

If the header parameter is what the version indicates (in this case 2014-12-08), what is the purpose of \v1\ in the URL?

+5
source share
1 answer

The answer that the engineer would like us to think is: I assume that at some point a serious change can occur in the Stripe API and how everything is organized, thereby wanting them to make such a big change as renaming it v2, Thus , v1 will be the major version, and then versions like 2014-12-08 will be minor versions. Thus, v1 is a form of semantic versioning.

However, what really happened, they released the first api and called in v1. Then they realized that they needed to update it and were โ€œwell, if we start changing v1 to v2, and then to v3, every time we release the update, users need to update their code to call the version they need. Therefore, they came up with this one which allows them to run API versions using the same URL, and v1 in the URL is just rudimentary.

+4
source

Source: https://habr.com/ru/post/1209027/


All Articles