You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add constants for release train / major version (and probably minor as well) #2001
Is your feature request related to a problem? Please describe.
Today we can get the current SDK API version by calling Stripe.API_VERSION
This is defined as a static final string, which resolves to something like 2025-04-30.basil
When comparing messages passed between different services that might be on different versions of the SDK, it's important to understand if they are on different release trains, since the versioning contract states that breaking changes are only introduced for new majors.
To get the release train/major version, we have to do something like Stripe.API_VERSION.split("\\.", 2)[1]
It would be nice if Stripe provided constants for major/release train (and probably minor version as well)
Describe the solution you'd like
Add a new constants in Stripe.java
With Stripe.API_VERSION returning 2025-04-30.basil
Something like Stripe.API_RELEASE_TRAIN which returns the release train/major version basil
or simply Stripe.API_MAJOR_VERSION which returns basil and Stripe.API_MINOR_VERSION which returns 2025-04-30
to avoid forcing users to do string parsing
Hi! I checked the current implementation and noticed that the generated ApiVersion class already exposes CURRENT_MAJOR, although it is package-private and is not currently surfaced through the public Stripe API.
Would you accept a PR exposing this value publicly through Stripe, for example as Stripe.API_VERSION_MAJOR or Stripe.API_RELEASE_TRAIN?
I could also add tests ensuring that the public constant remains consistent with the generated ApiVersion.CURRENT_MAJOR. I would avoid introducing a separate date-version constant unless that is also desired.
Ah, sorry about that! Small oversight on our part.
And thanks for the interest from both of you. But given that we need to fix this across a bunch of SDKs, I've taken care of it myself (#2261). When that's merged, I'll close this out.
Activity
xavdid-stripe commentedon May 16, 2025
Hey @dan-lind! That's a great suggestion- we'll look into adding it soon.
Add public ApiVersions constants for all known API versions
riken127 commentedon Jul 22, 2026
Hi! I checked the current implementation and noticed that the generated
ApiVersionclass already exposesCURRENT_MAJOR, although it is package-private and is not currently surfaced through the publicStripeAPI.Would you accept a PR exposing this value publicly through
Stripe, for example asStripe.API_VERSION_MAJORorStripe.API_RELEASE_TRAIN?I could also add tests ensuring that the public constant remains consistent with the generated
ApiVersion.CURRENT_MAJOR. I would avoid introducing a separate date-version constant unless that is also desired.ArthurJiang628 commentedon Jul 31, 2026
Hi I looked at this issue and I am very interested in dealing with it. Could you assign it to me? Thank you very much!
xavdid commentedon Jul 31, 2026
Ah, sorry about that! Small oversight on our part.
And thanks for the interest from both of you. But given that we need to fix this across a bunch of SDKs, I've taken care of it myself (#2261). When that's merged, I'll close this out.
xavdid commentedon Aug 10, 2026
This was released in
v33.3.0!