Skip to content

Add constants for release train / major version (and probably minor as well) #2001

@dan-lind

Description

@dan-lind

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

Describe alternatives you've considered

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions