Skip to content

Subscription creation example doesn't work on API 2025-03-31.basil #1212

@denisk20

Description

@denisk20

Bug report

Describe the bug

Subscription can't be created on 2025-03-31.basil because of this change
https://docs.stripe.com/changelog/basil/2025-03-31/add-support-for-multiple-partial-payments-on-invoices#use-for-payment-element-integrations

instead of expand: ['latest_invoice.payment_intent']
it should be expand: ['latest_invoice.confirmation_secret']

instead of

res.send({
      subscriptionId: subscription.id,
      clientSecret: subscription.latest_invoice.payment_intent.client_secret,
    })

it should be

res.send({
      subscriptionId: subscription.id,
      clientSecret: subscription.latest_invoice.confirmation_secret.client_secret,
    })

To Reproduce

Try to change

const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY, {
  apiVersion: '2022-08-01',

to

const stripe = require('stripe')(process.env.STRIPE_SECRET_KEY, {
  apiVersion: '2025-03-31.basil',

and create a subscription. It will fail because subscription.latest_invoice.payment_intent will be null.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions