2024-04-10
Breaking Changes4
Customer.default_source & Customer.default_card
The `default_source` and `default_card` fields on the Customer object are deprecated and will be removed in a future API version. Integrations should now use `invoice_settings.default_payment_method` to manage customer's default payment method.
customer.default_source = 'card_xyz'
customer.invoice_settings.default_payment_method = 'pm_xyz'
Update Customer object creation/update calls to use `invoice_settings.default_payment_method`.
Subscription.collection_method default
The default value for `collection_method` on new `Subscription` and `SubscriptionSchedule` objects is now `charge_automatically`. Previously, it defaulted to `send_invoice`. This impacts how new subscriptions are handled if not explicitly set.
Default collection_method: 'send_invoice'
Default collection_method: 'charge_automatically'
Explicitly set `collection_method` when creating new Subscriptions or Subscription Schedules if `send_invoice` is intended.
SetupIntent.usage default
The default value for `usage` on new `SetupIntent` objects is now `off_session`. Previously, it defaulted to `on_session`. This change affects how new SetupIntents behave if the usage is not explicitly specified.
Default usage for SetupIntent: 'on_session'
Default usage for SetupIntent: 'off_session'
Explicitly set `usage` to `on_session` when creating a new SetupIntent if the payment method is intended only for subsequent on-session payments.
Customer.account_tax_ids & Customer.default_tax_rates
The `account_tax_ids` and `default_tax_rates` fields on the Customer object have been moved and are now deprecated. `account_tax_ids` is replaced by `customer.tax.ids`, and `default_tax_rates` by `customer.invoice_settings.default_tax_rates`.
customer.account_tax_ids, customer.default_tax_rates
customer.tax.ids, customer.invoice_settings.default_tax_rates
Update code to use the new nested fields (`customer.tax.ids` and `customer.invoice_settings.default_tax_rates`) when managing customer tax information.
Newly Deprecated
Migration Checklist
Full interactive checklist →- 1Update Stripe API client libraries to the latest version compatible with `2024-04-10`.
- 2Review all subscription creation workflows and explicitly set `collection_method` to `send_invoice` or `charge_automatically` to match desired behavior.
- 3Review all `SetupIntent` creation workflows and explicitly set `usage` to `on_session` or `off_session` to match intended use of saved payment methods.
- 4Migrate any usage of `Customer.default_source` and `Customer.default_card` to `Customer.invoice_settings.default_payment_method`.
- 5Migrate any usage of `Customer.account_tax_ids` to `Customer.tax.ids` and `Customer.default_tax_rates` to `Customer.invoice_settings.default_tax_rates`.
- 6Thoroughly test payment processing, subscription creation, and saved payment method flows in a staging environment.
- 7Monitor payment success rates, subscription creations, and customer updates post-deployment for any unexpected behavior or regressions.
Never get blindsided by an API change again
Deprecatr AI monitors 150+ providers, maps changes to your codebase, and delivers migration checklists before your team hits a breaking change.
Join the Waitlist