InvoiceLineItem.modify method.create, retrieve, delete, and list methods on resource TaxIdinstance_url function on resource TaxId now returns the top-level /v1/tax_ids/{id} path instead of the /v1/customers/{customer}/tax_ids/{id} path.networks on Card, PaymentMethod.CreateParamsCard, PaymentMethod.ModifyParamsCard, and Token.CreateParamsCardno_voec on enums Checkout.Session.CustomerDetails.TaxId.type, Invoice.CustomerTaxId.type, Tax.Calculation.CustomerDetails.TaxId.type, Tax.Transaction.CustomerDetails.TaxId.type, and TaxId.typeno_voec on enums Customer.CreateParams.tax_id_data[].type, Invoice.UpcomingLinesParams.customer_details.tax_ids[].type, Invoice.UpcomingParams.customer_details.tax_ids[].type, and Tax.Calculation.CreateParams.customer_details.tax_ids[].typefinancial_connections.account.refreshed_ownership on enum Event.typedisplay_brand on PaymentMethod.cardfinancial_connections.account.refreshed_ownership on enums WebhookEndpoint.CreateParams.enabled_events[] and WebhookEndpoint.UpdateParams.enabled_events[]CreditNoteLineItem.list, CustomerCashBalanceTransaction.list, and CustomerCashBalanceTransaction.retrieve. These methods were included in the library unintentionally and never functioned.invoices on Account.Settingsvelobank on various enums PaymentMethodDetails.P24.banksetup_future_usage on PaymentMethodOptions.Blikrequire_cvc_recollection on PaymentMethodOptions.Cardaccount_tax_ids on various InvoiceSettings request parametersEntitlements.Event and Entitlements.Featurecreate method on resource Eventcreate and list methods on resource Featuretrio on HttpClientAsync.swish payment method throughout the APIrelationship on parameter classes Account.CreateParamsIndividual and Token.CreateParamsAccountIndividualjurisdiction_level on resource TaxRatestr to Literal["offline", "online"] of status on field terminal.Reader#1206 stripe-python v8 release
This release introduces StripeClient and a service-based call pattern. This new interface allows you to easily call Stripe APIs and has several benefits over the existing resource-based pattern:
For full migration instructions, please refer to the v8 migration guide.
"⚠️" symbol highlights breaking changes
api_key, stripe_account, stripe_version, and idempotency_key can no longer be passed in positionally on resource methods. Please pass these in as keyword arguments.BEFORE
stripe.Customer.create(
"sk_test_123", # api key
"KG5LxwFBepaKHyUD", # idempotency key
"2022-11-15", # stripe version
"acct_123", # stripe account
)
AFTER
stripe.Customer.create(
api_key="sk_test_123",
idempotency_key="KG5LxwFBepaKHyUD",
stripe_version="2022-11-15",
stripe_account="acct_123",
)
Quote.pdf) now returns a single value of type StripeResponseStream instead of a tuple containing (StripeResponseStream, api_key).APIRequestor. APIRequestor's main use is internal, and we don't have a good understanding of its external use cases. We had to make several breaking changes to its interface as part of this update, so rather than leaving it public we made it private. If you have a use case for APIRequestor, please open up a Github issue describing it. We'd rather you rely on something specifically designed for your use case than having to reach into the library's internals.api_version from File.create parameters. Please use stripe_version instead.util.read_special_variable() utility method (importing directly from stripe.util is deprecated as of v7.8.0)StripeError.construct_error_object(). This method was intended for internal stripe-python use only.ListObject.empty_list(). This method was intended for internal stripe-python use only.SearchResultObject.empty_search_result(). This method was intended for internal stripe-python use only.StripeObject.ReprJSONEncoder. This class was intended for internal stripe-python use only.StripeObject.api_base. This property was defunct and returned None.annual_revenue and estimated_worker_count on Account.business_profile, Account.CreateParams.business_profile, and Account.UpdateParams.business_profileregistered_charity on enums Account.CreateParams.company.structure, Account.UpdateParams.company.structure, and Token.CreateParams.account.company.structurecollection_options on AccountLink.CreateParamsliability on Checkout.Session.automatic_tax, PaymentLink.automatic_tax, PaymentLink.CreateParams.automatic_tax, PaymentLink.UpdateParams.automatic_tax, Quote.automatic_tax, Quote.CreateParams.automatic_tax, Quote.UpdateParams.automatic_tax, SubscriptionSchedule.default_settings.automatic_tax, SubscriptionSchedule.phases[].automatic_tax, SubscriptionSchedule.CreateParams.default_settings.automatic_tax, SubscriptionSchedule.CreateParams.phases[].automatic_tax, SubscriptionSchedule.UpdateParams.default_settings.automatic_tax, SubscriptionSchedule.UpdateParams.phases[].automatic_tax, and checkout.Session.CreateParams.automatic_taxissuer on Checkout.Session.invoice_creation.invoice_data, PaymentLink.invoice_creation.invoice_data, PaymentLink.CreateParams.invoice_creation.invoice_data, PaymentLink.UpdateParams.invoice_creation.invoice_data, Quote.invoice_settings, Quote.CreateParams.invoice_settings, Quote.UpdateParams.invoice_settings, SubscriptionSchedule.default_settings.invoice_settings, SubscriptionSchedule.phases[].invoice_settings, SubscriptionSchedule.CreateParams.default_settings.invoice_settings, SubscriptionSchedule.CreateParams.phases[].invoice_settings, SubscriptionSchedule.UpdateParams.default_settings.invoice_settings, SubscriptionSchedule.UpdateParams.phases[].invoice_settings, and checkout.Session.CreateParams.invoice_creation.invoice_datainvoice_settings on PaymentLink.subscription_data, PaymentLink.CreateParams.subscription_data, PaymentLink.UpdateParams.subscription_data, and checkout.Session.CreateParams.subscription_datachallenge on enums Invoice.CreateParams.payment_settings.payment_method_options.card.request_three_d_secure, Invoice.UpdateParams.payment_settings.payment_method_options.card.request_three_d_secure, Subscription.CreateParams.payment_settings.payment_method_options.card.request_three_d_secure, and Subscription.UpdateParams.payment_settings.payment_method_options.card.request_three_d_securepromotion_code on Invoice.UpcomingLinesParams.discounts[], Invoice.UpcomingLinesParams.invoice_items[].discounts[], Invoice.UpcomingParams.discounts[], and Invoice.UpcomingParams.invoice_items[].discounts[]account_type on PaymentMethod.UpdateParams.us_bank_accountnn on enum ConfirmationToken.PaymentMethodPreview.Ideal.bankNNBANL2G on enum ConfirmationToken.PaymentMethodPreview.Ideal.bicInvoice.AutomaticTax.liability, Invoice.issuer, and Subscription.AutomaticTax.liability to be requiredBankAccount, Card, and CardToken on Account.CreateExternalAccountParams.external_account and Account.CreateParams.external_accountnn on enums Charge.PaymentMethodDetails.Ideal.bank, PaymentIntent.ConfirmParamsPaymentMethodDataIdeal.bank, PaymentIntent.CreateParamsPaymenMethodDataIdeal.bank, PaymentIntent.UpdateParamsPaymentMethodDataIdeal.bank, PaymentMethod.Ideal.bank, PaymentMethod.CreateParamsIdeal.bank, SetupAttempt.PaymentMethodDetails.Ideal.bank, SetupIntent.ConfirmParamsPaymenMethodDataIdeal.bank, SetupIntent.CreateParamsPaymenMethodDataIdeal.bank, and SetupIntent.UpdateParamsPaymenMethodDataIdeal.bankNNBANL2G on enums Charge.PaymentMethodDetails.Ideal.bic, PaymentMethod.Ideal.bic, and SetupAttempt.PaymentMethodDetails.Ideal.bicCustomerSession.Components.buy_button and CustomerSession.Components.pricing_table to be requiredissuer on Invoice.CreateParams, Invoice.UpcomingLinesParams, Invoice.UpcomingParams, Invoice.UpdateParams, and Invoiceliability on Invoice.automatic_tax, Invoice.CreateParams.automatic_tax, Invoice.UpcomingLinesParams.automatic_tax, Invoice.UpcomingParams.automatic_tax, Invoice.UpdateParams.automatic_tax, Subscription.automatic_tax, Subscription.CreateParams.automatic_tax, and Subscription.UpdateParams.automatic_taxon_behalf_of on Invoice.UpcomingLinesParams and Invoice.UpcomingParamspin on issuing.Card.CreateParamsrevocation_reason on Mandate.PaymentMethodDetails.bacs_debitcustomer_balance on PaymentMethodConfiguration.CreateParams, PaymentMethodConfiguration.UpdateParams, and PaymentMethodConfigurationinvoice_settings on Subscription.CreateParams and Subscription.UpdateParamsCustomerSessioncreate method on resource CustomerSessionobligation_inbound, obligation_payout_failure, obligation_payout, and obligation_reversal_outbound from enum BalanceTransaction.typeeps and p24 on enums Invoice.payment_settings.payment_method_types[], InvoiceCreateParams.payment_settings.payment_method_types[], InvoiceUpdateParams.payment_settings.payment_method_types[], Subscription.payment_settings.payment_method_types[], SubscriptionCreateParams.payment_settings.payment_method_types[], and SubscriptionUpdateParams.payment_settings.payment_method_types[]obligation from enum Reporting.ReportRunCreateParams.parameters.reporting_categorybilling_cycle_anchor_config on SubscriptionCreateParams and Subscriptionretrieve on resource tax.RegistrationOptional[PaymentDetails] to PaymentDetails of payment_details on field AccountSession.ComponentsOptional[Payments] to Payments of payments on field AccountSession.ComponentsOptional[Payouts] to Payouts of payouts on field AccountSession.ComponentsOptional[Features] to Features of features on fields AccountSession.Components.PaymentDetails, AccountSession.Components.Payments, and AccountSession.Components.PayoutsOptional[InvoiceSettings] to InvoiceSettings of invoice_settings on field SubscriptionSchedule.DefaultSettings#1176 Update generated code
FinancialConnections.Transactionlist and retrieve methods on resource Transactionsubscribe and unsubscribe methods on resource FinancialConnections.Accountfeatures on AccountSessionCreateParams.components.payoutsedit_payout_schedule, instant_payouts, and standard_payouts on AccountSession.components.payouts.featuresCheckout.Session.payment_method_options.us_bank_account.financial_connections.prefetch[], Checkout.SessionCreateParams.payment_method_options.us_bank_account.financial_connections.prefetch[], Invoice.payment_settings.payment_method_options.us_bank_account.financial_connections.prefetch[], InvoiceCreateParams.payment_settings.payment_method_options.us_bank_account.financial_connections.prefetch[], InvoiceUpdateParams.payment_settings.payment_method_options.us_bank_account.financial_connections.prefetch[], PaymentIntent.payment_method_options.us_bank_account.financial_connections.prefetch[], PaymentIntentConfirmParams.payment_method_options.us_bank_account.financial_connections.prefetch[], PaymentIntentCreateParams.payment_method_options.us_bank_account.financial_connections.prefetch[], PaymentIntentUpdateParams.payment_method_options.us_bank_account.financial_connections.prefetch[], SetupIntent.payment_method_options.us_bank_account.financial_connections.prefetch[], SetupIntentConfirmParams.payment_method_options.us_bank_account.financial_connections.prefetch[], SetupIntentCreateParams.payment_method_options.us_bank_account.financial_connections.prefetch[], SetupIntentUpdateParams.payment_method_options.us_bank_account.financial_connections.prefetch[], Subscription.payment_settings.payment_method_options.us_bank_account.financial_connections.prefetch[], SubscriptionCreateParams.payment_settings.payment_method_options.us_bank_account.financial_connections.prefetch[], and SubscriptionUpdateParams.payment_settings.payment_method_options.us_bank_account.financial_connections.prefetch[] from literal('balances') to enum('balances'|'transactions')financial_connections.account.refreshed_transactions on enum Event.typetransactions on enum FinancialConnections.AccountRefreshParams.features[]subscriptions and transaction_refresh on FinancialConnections.Accountnext_refresh_available_at on FinancialConnections.Account.balance_refreshtransactions on enums FinancialConnections.Session.prefetch[] and FinancialConnections.SessionCreateParams.prefetch[]unknown on enums Issuing.Authorization.verification_data.authentication_exemption.type and Issuing.AuthorizationCreateParams.testHelpers.verification_data.authentication_exemption.typechallenge on enums PaymentIntent.payment_method_options.card.request_three_d_secure, PaymentIntentConfirmParams.payment_method_options.card.request_three_d_secure, PaymentIntentCreateParams.payment_method_options.card.request_three_d_secure, PaymentIntentUpdateParams.payment_method_options.card.request_three_d_secure, SetupIntent.payment_method_options.card.request_three_d_secure, SetupIntentConfirmParams.payment_method_options.card.request_three_d_secure, SetupIntentCreateParams.payment_method_options.card.request_three_d_secure, and SetupIntentUpdateParams.payment_method_options.card.request_three_d_securerevolut_pay on PaymentMethodConfigurationCreateParams, PaymentMethodConfigurationUpdateParams, and PaymentMethodConfigurationQuote.invoice_settings from InvoiceSettingQuoteSetting | null to InvoiceSettingQuoteSettingdestination_details on Refundfinancial_connections.account.refreshed_transactions on enums WebhookEndpointCreateParams.enabled_events[] and WebhookEndpointUpdateParams.enabled_events[]#1185 Update generated code
#1184 Remove api_base from RequestOptions type
#1178 Support accessing reserved word resource properties via attribute
#1161 Update generated code
payment_method_reuse_agreement on resource classes PaymentLink.ConsentCollection and checkout.Session.ConsentCollection and parameter classes PaymentLink.CreateParamsConsentCollection and checkout.Session.CreateParamsConsentCollectionafter_submit on parameter classes PaymentLink.CreateParamsCustomText, PaymentLink.ModifyParamsCustomText, and checkout.Session.CreateParamsCustomText and resource classes PaymentLink.CustomText and checkout.Session.CustomTextcreated on parameter class radar.EarlyFraudWarning.ListParams#1146 Track usage of deprecated save
.save in X-Stripe-Client-Telemetry. (You can disable telemetry via stripe.enable_telemetry = false, see the README.)#1101 Mark defunct and internal methods as deprecated
#1169 Add more types to _http_client.py