This release changes the pinned API version to 2025-04-30.basil
.
π Introducing new Stripe Client
Starting with v82.1, the new stripe.Client
type is replacing client.API
to provide a more ergonomic, consistent, and less error-prone experience. You create the former using stripe.NewClient(stripeKey)
. Itβs almost a drop-in replacement, except for the differences listed below.
- Service method names now align with Stripe API docs. The
stripe.Client
usesCreate
,Retrieve
,Update
, andDelete
(instead ofNew
,Get
,Update
, andDel
). - The first argument of each service method is a
context.Context
. - Parameter objects are now method-specific. For example,
CustomerCreateParams
andCustomerDeleteParams
instead of simplyCustomerParams
. This allows us to put the right fields in the right methods at compile time. - Services are all version-namespaced for symmetry. E.g.
stripeClient.V1Accounts
andstripeClient.V2Accounts
. List
methods return aniter.Seq2
, so they can be ranged over without explicit calls toNext
,Current
, andErr
.
π Native support in Go for V2 APIs
params := &stripe.V2CoreEventListParams{ObjectID: stripe.String("mtr_123")}
for event, err := range sc.V2CoreEvents.List(context.TODO(), params) {
// handle err
// process event object
}
- All V2 APIs are now supported natively through the
stripe.Client
More details can be found at https://github.com/stripe/stripe-go/wiki/Migration-guide-for-Stripe-Client
- #2029 Update generated code
- Add support for
MinorityOwnedBusinessDesignation
onAccountBusinessProfileParams
andAccountBusinessProfile
- Add support for
RegistrationDate
onAccountCompanyParams
,AccountCompany
, andTokenAccountCompanyParams
- Add support for
USCfpbData
onAccountParams
,PersonParams
,Person
, andTokenPersonParams
- Add support for new value
tax_id_prohibited
on enumsInvoiceLastFinalizationError.Code
,PaymentIntentLastPaymentError.Code
,SetupAttemptSetupError.Code
,SetupIntentLastSetupError.Code
, andStripeError.Code
- Add support for new value
verification_legal_entity_structure_mismatch
on enumsBankAccountFutureRequirementsErrors.Code
andBankAccountRequirementsErrors.Code
- Add support for
TaxID
onChargeBillingDetails
,ConfirmationTokenPaymentMethodDataBillingDetailsParams
,ConfirmationTokenPaymentMethodPreviewBillingDetails
,PaymentIntentConfirmPaymentMethodDataBillingDetailsParams
,PaymentIntentPaymentMethodDataBillingDetailsParams
,PaymentMethodBillingDetailsParams
,PaymentMethodBillingDetails
,SetupIntentConfirmPaymentMethodDataBillingDetailsParams
,SetupIntentPaymentMethodDataBillingDetailsParams
,TestHelpersConfirmationTokenPaymentMethodDataBillingDetailsParams
, andTreasuryOutboundPaymentDestinationPaymentMethodDataBillingDetailsParams
- Add support for
WalletOptions
onCheckoutSessionParams
andCheckoutSession
- Add support for
Provider
onCheckoutSessionAutomaticTax
,InvoiceAutomaticTax
, andQuoteAutomaticTax
- Add support for new values
aw_tin
,az_tin
,bd_bin
,bf_ifu
,bj_ifu
,cm_niu
,cv_nif
,et_tin
,kg_tin
, andla_tin
on enumsCheckoutSessionCustomerDetailsTaxIds.Type
,TaxCalculationCustomerDetailsTaxId.Type
,TaxId.Type
, andTaxTransactionCustomerDetailsTaxId.Type
- Add support for
PaymentMethodOptions
onConfirmationTokenParams
andTestHelpersConfirmationTokenParams
- Add support for
Installments
onConfirmationTokenPaymentMethodOptionsCard
- Add support for
Context
onEvent
- Add support for new value
affirm
on enumsInvoicePaymentSettings.PaymentMethodTypes
andSubscriptionPaymentSettings.PaymentMethodTypes
- Add support for
Billie
onPaymentIntentConfirmPaymentMethodOptionsParams
,PaymentIntentPaymentMethodOptionsParams
, andPaymentIntentPaymentMethodOptions
- Add support for
Pix
onPaymentMethodConfigurationParams
andPaymentMethodConfiguration
- Add support for
Klarna
onPaymentMethodDomain
- Add support for
PendingReason
onRefund
- Add support for
Aw
,Az
,Bd
,Bf
,Bj
,Cm
,Cv
,ET
,In
,Kg
,La
, andPh
onTaxRegistrationCountryOptionsParams
andTaxRegistrationCountryOptions
- Add support for
- #2022 Improved handling for enums in params
- You can now pass
string
enums intostripe.String
. For example,stripe.String(stripe.CurrencyUSD)
instead ofstripe.String(string(stripe.CurrencyUSD))
- You can now pass
- #1916 perf: do not computing signature when timestamp is not valid
- #1860 fix: typo in error
- #2018 Backport beta fixes