This release changes the pinned API version to 2026-06-24.dahlia.
#2748 Update generated code
release_details on Reserve.Holdtax_fund on enum BalanceTransaction.typeBilling.CreditGrant.priority to be requiredbuyer_id on Charge.payment_method_details.bizum, ConfirmationToken.payment_method_preview.bizum, ConfirmationToken.payment_method_preview.blik, PaymentAttemptRecord.payment_method_details.bizum, PaymentMethod.bizum, PaymentMethod.blik, and PaymentRecord.payment_method_details.bizumtransaction_link_id on Charge.payment_method_details.cardsui on enums Charge.payment_method_details.crypto.network, PaymentAttemptRecord.payment_method_details.crypto.network, and PaymentRecord.payment_method_details.crypto.networkusdsui on enums Charge.payment_method_details.crypto.token_currency, PaymentAttemptRecord.payment_method_details.crypto.token_currency, and PaymentRecord.payment_method_details.crypto.token_currencyfingerprint on Charge.payment_method_details.pix, ConfirmationToken.payment_method_preview.pix, PaymentMethod.pix, and SetupAttempt.payment_method_details.pixsunbit on Checkout.Session.payment_method_options, Checkout.SessionCreateParams.payment_method_options, PaymentIntent.payment_method_options, PaymentIntentConfirmParams.payment_method_options, PaymentIntentCreateParams.payment_method_options, and PaymentIntentUpdateParams.payment_method_optionsbilling_cycle_anchor_config on Checkout.SessionCreateParams.subscription_datawechat_pay on Checkout.Session.payment_method_optionsmastercard_compliance on Dispute.evidence.enhanced_evidence, Dispute.evidence_details.enhanced_eligibility, and DisputeUpdateParams.evidence.enhanced_evidencemastercard_compliance on enum Dispute.enhanced_eligibility_typesstatus_details on FinancialConnections.Accountvalidated on enum Identity.VerificationSession.redaction.statussatispay on enums InvoiceCreateParams.payment_settings.payment_method_types, InvoiceUpdateParams.payment_settings.payment_method_types, SubscriptionCreateParams.payment_settings.payment_method_types, and SubscriptionUpdateParams.payment_settings.payment_method_typessatispay on enums Invoice.payment_settings.payment_method_types and Subscription.payment_settings.payment_method_typesstored_credential_usage on PaymentAttemptRecord.payment_method_details.card and PaymentRecord.payment_method_details.cardPaymentAttemptRecord.payment_method_details.card.description and PaymentRecord.payment_method_details.card.description to be optionalPaymentAttemptRecord.payment_method_details.card.iin and PaymentRecord.payment_method_details.card.iin to be optionalPaymentAttemptRecord.payment_method_details.card.issuer and PaymentRecord.payment_method_details.card.issuer to be optionalsetup_future_usage on PaymentIntent.payment_method_options.satispay, PaymentIntentConfirmParams.payment_method_options.satispay, PaymentIntentCreateParams.payment_method_options.satispay, and PaymentIntentUpdateParams.payment_method_options.satispayPaymentRecordReportRefundParams.refunded to be optionalsatispay on SetupAttempt.payment_method_detailscustom_fields, description, and footer on Subscription.invoice_settings, SubscriptionCreateParams.invoice_settings, and SubscriptionUpdateParams.invoice_settingspayment_method_options and payment_method on TopupCreateParams2026-06-24.dahlia on enum WebhookEndpointCreateParams.api_versionmode on V2.Commerce.ProductCatalogImportpromotion on enum V2.Commerce.ProductCatalogImport.feed_typesunbit_payments on V2.Core.Account.configuration.merchant.capabilities, V2.Core.AccountCreateParams.configuration.merchant.capabilities, and V2.Core.AccountUpdateParams.configuration.merchant.capabilitiescrypto_money_manager and money_manager on V2.Core.AccountUpdateParams.identity.attestations.terms_of_servicecrypto_storer and storer on V2.Core.AccountUpdateParams.identity.attestations.terms_of_servicepromotion on enum V2.Commerce.ProductCatalogImportCreateParams.feed_typesunbit_payments on enum EventsV2CoreAccountIncludingConfigurationMerchantCapabilityStatusUpdatedEvent.updated_capabilityanomalous_money_movement_request, failed_tax_calculation, financial_account_balance_does_not_support_currency, financial_account_capability_not_enabled, and financial_account_capability_restricted on Invoice.last_finalization_error, PaymentIntent.last_payment_error, SetupAttempt.setup_error, SetupIntent.last_setup_error, StripeError, and Terminal.Reader.action.api_error#2765 fix: CJS companion namespace access for resource types at all depths
Stripe.Price.Recurring, Stripe.Subscription.BillingMode)Stripe.Billing.Alert.Status, Stripe.Terminal.Configuration.Tipping in both ESM and CJS modes.accounts.retrieveStripe.ErrorType.StripeError incorrectly being usable as a runtime class (reported in #2661)This release changes the pinned API version to 2026-05-27.dahlia.
V2.Commerce.ProductCatalogImportcreate and retrieve methods on resource V2.Commerce.ProductCatalogImportbizum_payments and scalapay_payments on Account.capabilities, AccountCreateParams.capabilities, and AccountUpdateParams.capabilitiesautomatic_transfer_rules_by_currency on BalanceSettingUpdateParams.payments.payouts and BalanceSettings.payments.payoutsstart_of_day on BalanceSettingUpdateParams.payments.settlement_timing and BalanceSettings.payments.settlement_timingdescription on ChargeCreateParams.transfer_data, PaymentIntent.transfer_data, PaymentIntentCreateParams.transfer_data, and PaymentIntentUpdateParams.transfer_databizum on Charge.payment_method_details, ConfirmationToken.payment_method_preview, ConfirmationTokenCreateParams.testHelpers.payment_method_data, PaymentAttemptRecord.payment_method_details, PaymentIntent.payment_method_options, PaymentIntentConfirmParams.payment_method_data, PaymentIntentConfirmParams.payment_method_options, PaymentIntentCreateParams.payment_method_data, PaymentIntentCreateParams.payment_method_options, PaymentIntentUpdateParams.payment_method_data, PaymentIntentUpdateParams.payment_method_options, PaymentMethodConfigurationCreateParams, PaymentMethodConfigurationUpdateParams, PaymentMethodConfiguration, PaymentMethodCreateParams, PaymentMethod, PaymentRecord.payment_method_details, SetupIntent.payment_method_options, SetupIntentConfirmParams.payment_method_data, SetupIntentConfirmParams.payment_method_options, SetupIntentCreateParams.payment_method_data, SetupIntentCreateParams.payment_method_options, SetupIntentUpdateParams.payment_method_data, and #2703 Export Decimal type from Stripe namespace
Stripe.Decimal as a usable type in the Stripe namespace, enabling type annotations like function takesDecimal(d: Stripe.Decimal).#2704 Fix file upload regression: restore multipart request data processor
StripeInvalidRequestError on the /v1/files endpoint since v22.This release changes the pinned API version to 2026-04-22.dahlia.
app_distribution and sunbit_payments on Account.capabilities, AccountCreateParams.capabilities, and AccountUpdateParams.capabilitiesbalance_report and payout_reconciliation_report on AccountSession.components and AccountSessionCreateParams.componentsfee_credit_funding, inbound_transfer_reversal, and inbound_transfer on enum BalanceTransaction.typesunbit on Charge.payment_method_details, ConfirmationToken.payment_method_preview, ConfirmationTokenCreateParams.testHelpers.payment_method_data, PaymentAttemptRecord.payment_method_details, PaymentIntentConfirmParams.payment_method_data, PaymentIntentCreateParams.payment_method_data, PaymentIntentUpdateParams.payment_method_data, PaymentMethodConfigurationCreateParams, PaymentMethodConfigurationUpdateParams, PaymentMethodConfiguration, PaymentMethodCreateParams, PaymentMethod, PaymentRecord.payment_method_details, SetupIntentConfirmParams.payment_method_data, SetupIntentCreateParams.payment_method_data, and SetupIntentUpdateParams.payment_method_dataphantom_cash and usdt on enums Charge.payment_method_details.crypto.token_currency, PaymentAttemptRecord.payment_method_details.crypto.token_currency, and PaymentRecord.payment_method_details.crypto.token_currencylocation and reader on Charge.payment_method_details.klarna, PaymentAttemptRecord.payment_method_details.klarna, and PaymentRecord.payment_method_details.klarnamandate on Charge.payment_method_details.pix, PaymentAttemptRecord.payment_method_details.pix, and PaymentRecord.payment_method_details.pixmanaged_payments on Checkout.SessionCreateParams, , , , , , and parseEventNotificationAsync to match existing sync functionemitEventBodies config option to include request and response bodies in request/response events.httpClient config type from HttpClient class to HttpClientInterface interface.// ✅ Fixed
import { Stripe } from 'stripe';
new keyword is now possible for CJS based TypeScript project. Resolves: 2660import Stripe = require('stripe');
// ✅ Both statements work
const stripeNew: Stripe.Stripe = new Stripe('sk_test_...');
const stripeCalled: Stripe.Stripe = Stripe('sk_test_...');
This release uses the same pinned API version to 2026-03-25.dahlia as the last major release. The breaking changes in this release are prefixed with ⚠️ below. There's also a detailed migration guide to simplify your upgrade process.
Stripe.StripeContext is no longer exported as a type. Use Stripe.StripeContextType instead.Stripe.errors.StripeError is no longer a type. Use typeof Stripe.errors.StripeError or Stripe.ErrorType instead.new Stripe() to create a StripeClient instead of calling it:// Before
const stripeClient = Stripe("sk_test_...");
// After
const stripeClient = new Stripe("sk_test_...");
#2645 ⚠️ Remove stripeMethod and standardize how function args are handled (including removing callback support)
async / await insteadRequestOptions under the apiKey propertyparams and options objects are no longer mixed. If present on a method, RequestParams must always come first and RequestOptions must always come second. To supply options without params, pass undefined as the first argument explicitlyStripeResource: createFullPath, createResourcePathWithSymbols, extend, method and _joinUrlParts. These were mostly intended for internal use and we no longer need themAs a result, the following call patterns are no longer supported:
stripe.customers.retrieve('cus_123', 'sk_test_123')
stripe.customers.create({name: 'david', host: 'example.com'}, 'sk_test_123')
This release changes the pinned API version to 2026-03-25.dahlia and contains breaking changes (prefixed with ⚠️ below). There's also a detailed migration guide to simplify your upgrade process.
Please review details for the breaking changes and alternatives in the Stripe API changelog before upgrading.
Note: we're releasing another major version very soon that overhauls and improves the package's structure and typescript types. That will also use
2026-03-25.dahliaas an API version and will mostly be a drop-in replacement.
decimal_string fields changed type from string to Stripe.Decimal in both request params and response objects. Code that reads or writes these fields as string will need to use Stripe.Decimal instead (construct via Decimal.from("1.23"), serialize via .toString()). Affected fields across v1 and v2 APIs:
currency_conversion.fx_ratemetric_tons; Climate.Product: metric_tons_availableunit_amount_decimalquantity_decimal, unit_amount_decimalquantity_decimal, unit_amount_decimalquantity_decimal, unit_cost_decimal, gross_amount_decimal, local_amount_decimal, national_amount_decimalamount_decimal, flat_amount_decimal, unit_amount_decimalunit_amount_decimal, flat_amount_decimal (including currency_options and tiers)percent_ownershipunit_amount_decimal, flat_amount_decimal, quantity_decimal (where applicable)SetupIntentUpdateParams.payment_method_optionsscalapay on Charge.payment_method_details, Checkout.Session.payment_method_options, Checkout.SessionCreateParams.payment_method_options, ConfirmationToken.payment_method_preview, ConfirmationTokenCreateParams.testHelpers.payment_method_data, PaymentAttemptRecord.payment_method_details, PaymentIntent.payment_method_options, PaymentIntentConfirmParams.payment_method_data, PaymentIntentConfirmParams.payment_method_options, PaymentIntentCreateParams.payment_method_data, PaymentIntentCreateParams.payment_method_options, PaymentIntentUpdateParams.payment_method_data, PaymentIntentUpdateParams.payment_method_options, PaymentMethodConfigurationCreateParams, PaymentMethodConfigurationUpdateParams, PaymentMethodConfiguration, PaymentMethodCreateParams, PaymentMethod, PaymentRecord.payment_method_details, Refund.destination_details, SetupIntentConfirmParams.payment_method_data, SetupIntentCreateParams.payment_method_data, and SetupIntentUpdateParams.payment_method_datamandate on Charge.payment_method_details.twint, PaymentAttemptRecord.payment_method_details.twint, and PaymentRecord.payment_method_details.twintbizum and scalapay on enums Checkout.SessionCreateParams.excluded_payment_method_types, PaymentIntentConfirmParams.excluded_payment_method_types, PaymentIntentCreateParams.excluded_payment_method_types, PaymentIntentUpdateParams.excluded_payment_method_types, SetupIntentCreateParams.excluded_payment_method_types, and SetupIntentUpdateParams.excluded_payment_method_typesCheckout.SessionCreateParams.payment_method_options.twint.setup_future_usage, PaymentIntentConfirmParams.payment_method_options.twint.setup_future_usage, PaymentIntentCreateParams.payment_method_options.twint.setup_future_usage, and PaymentIntentUpdateParams.payment_method_options.twint.setup_future_usage from literal('none') to enum('none'|'off_session')bizum and scalapay on enum Checkout.SessionCreateParams.payment_method_typesCheckout.Session.payment_method_options.twint.setup_future_usage and PaymentIntent.payment_method_options.twint.setup_future_usage from literal('none') to enum('none'|'off_session')bizum and scalapay on enums ConfirmationTokenCreateParams.testHelpers.payment_method_data.type, PaymentIntentConfirmParams.payment_method_data.type, PaymentIntentCreateParams.payment_method_data.type, PaymentIntentUpdateParams.payment_method_data.type, SetupIntentConfirmParams.payment_method_data.type, SetupIntentCreateParams.payment_method_data.type, and SetupIntentUpdateParams.payment_method_data.typebizum and scalapay on enums ConfirmationToken.payment_method_preview.type and PaymentMethod.typebizum and scalapay on enums CustomerListPaymentMethodsParams.type, PaymentMethodCreateParams.type, and PaymentMethodListParams.typecredited_items on InvoiceItem.proration_detailstwint on enums InvoiceCreateParams.payment_settings.payment_method_types, InvoiceUpdateParams.payment_settings.payment_method_types, SubscriptionCreateParams.payment_settings.payment_method_types, and SubscriptionUpdateParams.payment_settings.payment_method_typesdiscountable on InvoiceCreatePreviewParams.schedule_details.phases[].add_invoice_items[], SubscriptionCreateParams.add_invoice_items[], SubscriptionSchedule.phases[].add_invoice_items[], SubscriptionScheduleCreateParams.phases[].add_invoice_items[], SubscriptionScheduleUpdateParams.phases[].add_invoice_items[], and SubscriptionUpdateParams.add_invoice_items[]billing_schedules on InvoiceCreatePreviewParams.subscription_details, SubscriptionCreateParams, SubscriptionUpdateParams, and Subscriptionmax_billed_until on enums InvoiceCreatePreviewParams.subscription_details.cancel_at, SubscriptionCreateParams.cancel_at, and SubscriptionUpdateParams.cancel_atamount_paid_off_stripe on Invoicetwint on enums Invoice.payment_settings.payment_method_types and Subscription.payment_settings.payment_method_typestwint on Mandate.payment_method_details and SetupAttempt.payment_method_detailsmetadata on PaymentIntent.transfer_data, PaymentIntentCreateParams.transfer_data, PaymentIntentUpdateParams.transfer_data, and Subscription.pending_updatepayment_data on PaymentIntent.transfer_data, PaymentIntentCreateParams.transfer_data, and PaymentIntentUpdateParams.transfer_databizum and scalapay on enums PaymentIntent.excluded_payment_method_types and SetupIntent.excluded_payment_method_typesblik_authorize on PaymentIntent.next_action and SetupIntent.next_actionpayment_method_options on PaymentLinkCreateParams, PaymentLinkUpdateParams, and PaymentLinkbizum on enums PaymentLinkCreateParams.payment_method_types and PaymentLinkUpdateParams.payment_method_typesbizum on enum PaymentLink.payment_method_typesactive on PaymentMethodConfigurationListParamsbilled_until on SubscriptionItemdiscount and discounts on Subscription.pending_updateverifone_m425, verifone_p630, verifone_ux700, and verifone_v660p on Terminal.ConfigurationCreateParams, Terminal.ConfigurationUpdateParams, and Terminal.Configurationsimulated_verifone_m425, simulated_verifone_p630, simulated_verifone_ux700, simulated_verifone_v660p, verifone_m425, verifone_p630, verifone_ux700, and verifone_v660p on enum Terminal.ReaderListParams.device_typeapi_error and print_content on Terminal.Reader.actionprint_content on enum Terminal.Reader.action.typesimulated_verifone_m425, simulated_verifone_p630, simulated_verifone_ux700, simulated_verifone_v660p, verifone_m425, verifone_p630, verifone_ux700, and verifone_v660p on enum Terminal.Reader.device_typecustomer on TestHelpers.TestClockCreateParams2026-05-27.dahlia on enum WebhookEndpointCreateParams.api_versionsigner on V2.Core.Account.identity.business_details.documents.proof_of_registration, V2.Core.Account.identity.business_details.documents.proof_of_ultimate_beneficial_ownership, V2.Core.AccountCreateParams.identity.business_details.documents.proof_of_registration, V2.Core.AccountCreateParams.identity.business_details.documents.proof_of_ultimate_beneficial_ownership, V2.Core.AccountTokenCreateParams.identity.business_details.documents.proof_of_registration, V2.Core.AccountTokenCreateParams.identity.business_details.documents.proof_of_ultimate_beneficial_ownership, V2.Core.AccountUpdateParams.identity.business_details.documents.proof_of_registration, and V2.Core.AccountUpdateParams.identity.business_details.documents.proof_of_ultimate_beneficial_ownershipazure_event_grid on V2.Core.EventDestinationCreateParams and V2.Core.EventDestinationno_azure_partner_topic_exists on enum V2.Core.EventDestination.status_details.disabled.reasonazure_event_grid on enum V2.Core.EventDestination.typeazure_event_grid on enum V2.Core.EventDestinationCreateParams.typemeter_event_value_too_many_digits on enums EventsV1BillingMeterErrorReportTriggeredEvent.reason.error_types[].code and EventsV1BillingMeterNoMeterFoundEvent.reason.error_types[].codeV2CommerceProductCatalogImportsFailedEvent, V2CommerceProductCatalogImportsProcessingEvent, V2CommerceProductCatalogImportsSucceededEvent, and V2CommerceProductCatalogImportsSucceededWithErrorsEvent with related object V2.Commerce.ProductCatalogImportpayment_method_microdeposit_processing_error and siret_invalid on Invoice.last_finalization_error, PaymentIntent.last_payment_error, SetupAttempt.setup_error, SetupIntent.last_setup_error, and StripeErrorstripe-notify header is present in responseV2List and V2ListPromise types to represent API v2 list responses. These types include deprecated fields from the previously returned list shapes. These fields will be removed in the next major release.// ❌ Before (v22.0.0-v22.1.1)
const oAuthToken: Stripe.OAuthToken = {};
// ✅ After (works on v22.1.2+)
const oAuthToken: Stripe.OAuthToken = {};
Stripe.V2.Core.AccountCreateParams.Configuration, Stripe.V2.Core.AccountCreateParams.Dashboard) are now accessible.Checkout.SessionPaymentIntentPaymentLinkCreateParamsPaymentLinkSetupIntentSubscriptionsunbit on enums Checkout.SessionCreateParams.excluded_payment_method_types, PaymentIntentConfirmParams.excluded_payment_method_types, PaymentIntentCreateParams.excluded_payment_method_types, PaymentIntentUpdateParams.excluded_payment_method_types, SetupIntentCreateParams.excluded_payment_method_types, and SetupIntentUpdateParams.excluded_payment_method_typesmandate_options on Checkout.Session.payment_method_options.pix, Checkout.SessionCreateParams.payment_method_options.pix, PaymentIntent.payment_method_options.pix, PaymentIntentConfirmParams.payment_method_options.pix, PaymentIntentCreateParams.payment_method_options.pix, and PaymentIntentUpdateParams.payment_method_options.pixCheckout.SessionCreateParams.payment_method_options.pix.setup_future_usage, PaymentIntentConfirmParams.payment_method_options.pix.setup_future_usage, PaymentIntentCreateParams.payment_method_options.pix.setup_future_usage, and PaymentIntentUpdateParams.payment_method_options.pix.setup_future_usage from literal('none') to enum('none'|'off_session')sunbit on enum Checkout.SessionCreateParams.payment_method_typesfo_vat, gi_tin, it_cf, and py_ruc on enums Checkout.Session.customer_details.tax_ids[].type, Invoice.customer_tax_ids[].type, Tax.Calculation.customer_details.tax_ids[].type, Tax.Transaction.customer_details.tax_ids[].type, and TaxId.typeCheckout.Session.payment_method_options.pix.setup_future_usage and PaymentIntent.payment_method_options.pix.setup_future_usage from literal('none') to enum('none'|'off_session')sunbit on enums ConfirmationTokenCreateParams.testHelpers.payment_method_data.type, PaymentIntentConfirmParams.payment_method_data.type, PaymentIntentCreateParams.payment_method_data.type, PaymentIntentUpdateParams.payment_method_data.type, SetupIntentConfirmParams.payment_method_data.type, SetupIntentCreateParams.payment_method_data.type, and SetupIntentUpdateParams.payment_method_data.typesunbit on enums ConfirmationToken.payment_method_preview.type and PaymentMethod.typefo_vat, gi_tin, it_cf, and py_ruc on enums CustomerCreateParams.tax_id_data[].type, CustomerCreateTaxIdParams.type, InvoiceCreatePreviewParams.customer_details.tax_ids[].type, Tax.CalculationCreateParams.customer_details.tax_ids[].type, and TaxIdCreateParams.typesunbit on enums CustomerListPaymentMethodsParams.type, PaymentMethodCreateParams.type, and PaymentMethodListParams.typepix on Invoice.payment_settings.payment_method_options, InvoiceCreateParams.payment_settings.payment_method_options, InvoiceUpdateParams.payment_settings.payment_method_options, Mandate.payment_method_details, SetupAttempt.payment_method_details, SetupIntent.payment_method_options, SetupIntentConfirmParams.payment_method_options, SetupIntentCreateParams.payment_method_options, SetupIntentUpdateParams.payment_method_options, Subscription.payment_settings.payment_method_options, SubscriptionCreateParams.payment_settings.payment_method_options, and SubscriptionUpdateParams.payment_settings.payment_method_optionsupi on Invoice.payment_settings.payment_method_options, InvoiceCreateParams.payment_settings.payment_method_options, InvoiceUpdateParams.payment_settings.payment_method_options, Subscription.payment_settings.payment_method_options, SubscriptionCreateParams.payment_settings.payment_method_options, and SubscriptionUpdateParams.payment_settings.payment_method_optionspix and upi on enums InvoiceCreateParams.payment_settings.payment_method_types, InvoiceUpdateParams.payment_settings.payment_method_types, SubscriptionCreateParams.payment_settings.payment_method_types, and SubscriptionUpdateParams.payment_settings.payment_method_typespix and upi on enums Invoice.payment_settings.payment_method_types and Subscription.payment_settings.payment_method_typescard_presence on Issuing.Authorizationallowed_card_presences and blocked_card_presences on Issuing.Card.spending_controls, Issuing.CardCreateParams.spending_controls, Issuing.CardUpdateParams.spending_controls, Issuing.Cardholder.spending_controls, Issuing.CardholderCreateParams.spending_controls, and Issuing.CardholderUpdateParams.spending_controlsfulfillment_error on enum Issuing.Card.cancellation_reasonfulfillment_error on enum Issuing.Card.replacement_reasonamount and currency on Mandate.multi_useamount_to_confirm on PaymentIntentConfirmParamssunbit on enums PaymentIntent.excluded_payment_method_types and SetupIntent.excluded_payment_method_typesklarna_display_qr_code on PaymentIntent.next_actionsunbit on enums PaymentLinkCreateParams.payment_method_types and PaymentLinkUpdateParams.payment_method_typessunbit on enum PaymentLink.payment_method_typeslow, not_assessed, and unknown on enum Radar.PaymentEvaluation.signals.fraudulent_payment.risk_levelaccount on enum Radar.ValueListCreateParams.item_typeaccount on enum Radar.ValueList.item_typemoto on SetupAttempt.payment_method_details.cardpix_display_qr_code on SetupIntent.next_action2026-04-22.dahlia on enum WebhookEndpointCreateParams.api_versionaction_blocked and approval_required on Invoice.last_finalization_error, PaymentIntent.last_payment_error, SetupAttempt.setup_error, SetupIntent.last_setup_error, and StripeErrorStripe constructor config parameter to use StripeConfig type instead of Record<string, unknown>, restoring compile-time type safety.authenticator property to StripeConfig.Stripe.API_VERSION to retain the literal API version type.StripeConfig.stripeContext to accept StripeContext objects in addition to strings.rawRequest with absolute urlsstring[] to WebhookHeader type for compatibility with express
string[] to the type of signature param in stripe.webhooks.construct_event method.If those look familiar, head over to the migration guide to update your code.
#2643 ⚠️ Removed per-request host override. To use a custom host, set it in the client configuration. All requests from that client will use that host.
Before:
import Stripe from 'stripe';
const stripe = new Stripe('sk_test_...');
const customer = await stripe.customers.create({
email: 'customer@example.com',
}, {host: 'example.com'});
After:
import Stripe from 'stripe';
const stripe = new Stripe('sk_test_...', {host: 'example.com'});
// goes to example.com
const customer = await stripe.customers.create({
email: 'customer@example.com',
});
#2619 Improved TypeScript support in the Node SDK
#2638 Converted V2/Amount.ts to V2/V2Amount.ts
#2635 Updated stripe.spec.ts test and constructEvent.tolerance type