The Stripe API documentation for versioning states:
When we make backwards-incompatible changes to the API, we release new dated versions. The current version is 2014-12-08.
It provides an example of how to access 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 specifies the version (in this case 2014-12-08), what purpose does the \v1\
in the url serve?
API Endpoint Definition API v1. The original version of the API Endpoint Definition API associates API endpoints with a Kona Site Defender configuration to monitor security issues. Learn more: Download this API's RAML and JSON schema descriptors.
"v2" generally relates to the swagger APIs included in V10+. Differences will be the URL of the API endpoint, the format of the request, the returned properties and possibly another previously unavailable capability. Examples.
The current version is 2022-08-01. Read our API upgrades guide to learn more about backwards compatibility. For all API updates, view our API changelog. All requests use your account API settings, unless you override the API version.
API stands for “Application Programming Interface.” APIs give individuals and companies the power to add functionality to a website, application, platform, or software without having to actually write the code.
The answer an engineer would want us to think: I'm guessing at a certain point, there may be a major change to Stripe's API and how everything is orchestrated, thus wanting them to make such a large change as renaming it v2. In this way v1 would be a major version, and then versions like 2014-12-08 would be minor versions. Thus v1 is a form of semantic versioning.
However, what likely really happened is they released the first api and called in v1. Then they realized they had to start updating it and were like "well if we start changing v1 to v2 and then to v3, every time we release an update users need to update their code to call the right version. So they came up with this version header that lets them gate the API versions using the same URL and the v1 in the url is just vestigial.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With