Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the /v1/ for in Stripe API urls?

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?

like image 224
Matthew Piziak Avatar asked Dec 14 '14 21:12

Matthew Piziak


People also ask

What is v1 in API?

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.

What does v2 mean in URL?

"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.

What is the current version of Stripe API?

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.

What does API stand for in Stripe?

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.


1 Answers

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.

like image 193
Matthew Arkin Avatar answered Oct 03 '22 03:10

Matthew Arkin