title: Stripe - PaymentIntent is null when I create or update a subscription
body: <p>I'm new to Stripe, so if I'm missing something, please advise.</p>
  <p>Tech Stack:
  React (front-end)
  Node (back-end)</p>
  <p>I am trying to create or update a Stripe subscription, and in either case, I get a null paymentIntent. I thought I read that I should check the paymentIntent status to make sure the payment for the subscription has gone through.</p>
  <p>My subscription workflow, when a user signs up, I create a Stripe customer and add them to a subscription. This subscription is a free tier so no payment method is needed. The <code>payment_intent</code> is null.</p>
  <pre><code>//create a Stripe customer code here
  ...
  
  //create the subscription 
  const subscription = await stripe.subscriptions.create({
      customer: customer.id,
      items: [{ priceID }],
      expand: ['latest_invoice.payment_intent'],
  });
  
  const invoice = subscription.latest_invoice as Stripe.Invoice;
  const payment_intent = invoice.payment_intent as Stripe.PaymentIntent;
  </code></pre>
  <p>Later after they want to upgrade to a paid plan, I request a credit card and upgrade their current subscription to a paid plan. On the front-end, I use Stripe Element and create a payment method by doing this.</p>
  <pre><code>if (!elements || !stripe) {
       return 
  }
  
  const cardElement = elements.getElement(CardElement);
  
  if (!cardElement) {
       return
  }
  
  // Confirm Card Setup
  const { 
       error, 
       paymentMethod 
  } = await stripe.createPaymentMethod({
       type: 'card',
       card: cardElement,
       billing_details:{
            name,
            email: currentUser.email,
            phone,
            address: {
                 city,
                 line1: address,
                 state,
            },
       }
  });
  
  if (error) {
       console.log(&quot;createPaymentMethod: &quot;, error.message)
  } else {
       const paymentMethodId = paymentMethod!.id
       // Switch to new subscription
       await switchSubscription(priceID, paymentMethodId)
  }
      
  </code></pre>
  <p>And on the back-end, I get the stripe customer, add a payment method, and upgrade the subscription to the new plan.  The <code>payment_intent</code> is null.</p>
  <pre><code>function switchSubscription(priceID, user, paymentMethod) {
       //get Stripe customer code here ...
       ...
  
       await stripe.paymentMethods.attach(paymentMethod, { customer: customer.id });
       await stripe.customers.update(customer.id, {
          invoice_settings: { default_payment_method: paymentMethod },
      });
  
      const currentSubscription = await getSubscriptions(user)
  
       const updatedSubscription = await stripe.subscriptions.update(
            currentSubscription.id,
       {
            cancel_at_period_end: false,
            proration_behavior: 'always_invoice',
            items: [
                 {
                      id: currentSubscription.items.data[0].id,
                      price: priceID,
                 },
            ],
            expand: ['latest_invoice.payment_intent'],
       })
  
       const invoice = updatedSubscription.latest_invoice as Stripe.Invoice;
       const payment_intent = invoice.payment_intent as Stripe.PaymentIntent;
  }
  </code></pre>