Stripe API version upgrades, checked against your code.
Stripe dates its API versions, and every request runs against one: your account's default, or the version your code sets.
Moving to a newer version can remove or reshape fields your code reads. GitGo shows you which lines before you switch.
An upgrade from 2022-08-01 to 2022-11-15.
GitGo CLI output for a small TypeScript file, on sample data based on Stripe's API. The counts are not Stripe's.
| 5 | export async function latestCharge(id: string) { |
| 6 | const pi = await stripe.paymentIntents.retrieve(id); |
| 7 | const chargeId = pi.charges.data[0].id; |
| charges removed in 2022-11-15 | |
| 8 | const { charges, latest_charge: latest } = await stripe.paymentIntents.retrieve(id); |
| charges removedlatest_charge is new | |
| 9 | console.log(charges.total_count, latest); |
| charges removed | |
| 10 | const status = (await stripe.paymentIntents.retrieve(id)).status; |
| 11 | const list = await stripe.paymentIntents.list({ limit: 3 }); |
| 12 | for (const item of list.data) { |
| 13 | console.log(item.charges.url); |
| data[].charges removed | |
| 14 | } |
| 15 | return [chargeId, status]; |
| 16 | } |
What GitGo checks for Stripe.
- stripe-node calls in TypeScript and JavaScript, and stripe-python calls in Python
- The API version each Stripe client pins
- Response fields your code reads
- Removed operations, fields that became optional or nullable, and new enum values
What changed in Stripe API version 2022-11-15
Two changes in this version break code that reads PaymentIntents and Charges:
- PaymentIntent responses no longer include charges. Read latest_charge instead.
- Charge responses no longer include refunds by default, so code that reads them must expand them.
The output on this page uses sample data, so its counts are not Stripe's.
The fix will arrive as a pull request.
GitGo will write a fix for each line that breaks and open a pull request, with the replay result from your CI. You review and merge, or let GitGo merge when your checks pass.
gitgo-hq[bot] wants to merge 1 commit into main
Stripe removed charges from PaymentIntent responses in 2022-11-15. This reads latest_charge instead and moves the pinned version.
- gitgo/deprecationsNo breaking usages left for 2022-11-15
- Your CITests passed
Stripe questions.
How do I upgrade the Stripe API version safely?
Download the OpenAPI descriptions for your current version and the target version, run gitgo scan --from current.json --to target.json against your code, and fix each breaking line it reports. Then change the apiVersion your Stripe client pins. A hosted service that writes those fixes as a pull request is in development.
Which Stripe SDKs does GitGo read?
stripe-node in TypeScript and JavaScript, and stripe-python. Other languages are not scanned yet.

Upgrade the API version you have been putting off.
Run the CLI against your code, or connect a repository and let GitGo watch it.