DeprecatrAI

2024-04-10

Released 2024-04-10Active
Migration Effort
Medium
Estimated Hours
~12h
Primary risk if skipped: Revenue loss due to failed payments, incorrect subscription billing, or mismanaged saved payment methods if defaults are not handled.

Breaking Changes4

fieldHighBillingPayments

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.

Before
customer.default_source = 'card_xyz'
After
customer.invoice_settings.default_payment_method = 'pm_xyz'

Update Customer object creation/update calls to use `invoice_settings.default_payment_method`.

fieldCriticalBilling

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.

Before
Default collection_method: 'send_invoice'
After
Default collection_method: 'charge_automatically'

Explicitly set `collection_method` when creating new Subscriptions or Subscription Schedules if `send_invoice` is intended.

fieldHighPayments

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.

Before
Default usage for SetupIntent: 'on_session'
After
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.

fieldMediumTaxBilling

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`.

Before
customer.account_tax_ids, customer.default_tax_rates
After
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

field
Sunset: future API version · Replace with: customer.invoice_settings.default_payment_method
field
Sunset: future API version · Replace with: customer.tax.ids
field
Sunset: future API version · Replace with: customer.invoice_settings.default_tax_rates
  1. 1Update Stripe API client libraries to the latest version compatible with `2024-04-10`.
  2. 2Review all subscription creation workflows and explicitly set `collection_method` to `send_invoice` or `charge_automatically` to match desired behavior.
  3. 3Review all `SetupIntent` creation workflows and explicitly set `usage` to `on_session` or `off_session` to match intended use of saved payment methods.
  4. 4Migrate any usage of `Customer.default_source` and `Customer.default_card` to `Customer.invoice_settings.default_payment_method`.
  5. 5Migrate any usage of `Customer.account_tax_ids` to `Customer.tax.ids` and `Customer.default_tax_rates` to `Customer.invoice_settings.default_tax_rates`.
  6. 6Thoroughly test payment processing, subscription creation, and saved payment method flows in a staging environment.
  7. 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