79664962

Date: 2025-06-13 14:05:00
Score: 0.5
Natty:
Report link

The simplest way to handle this would be to use a SetupIntent to create a Payment Method, then create all 5 subscriptions using the resulting Payment Method.

Stripe has a pretty thorough guide that covers the basics of using SetupIntents here:

https://docs.stripe.com/payments/save-and-reuse

For your specific flow it would look something like this:

  1. Create a Customer
const customer = await stripe.customers.create();
  1. Create the SetupIntent
const setupIntent = await stripe.setupIntents.create({
  customer: customer.id,
  usage: "off_session"
});
  1. Collect and confirm the payment details on the frontend using Stripe Elements

  2. Verify that the payment method has been created and attached to the customer (one way to do that would be listening for the payment_method.attached webhook event

  3. Create your subscriptions like so:

const subscription = await stripe.subscriptions.create({
  customer: customer.id,
  items: [
    {
      price: priceId,
    },
  ],
  default_payment_method: yourPMId
});

Alternatively, rather than providing the Payment Method ID when creating the subscription you can update the customer's default Payment Method: https://docs.stripe.com/api/customers/update#update_customer-invoice_settings-default_payment_method

It's also worth noting that if the billing period is the same for all of the subscriptions, you can just add them all as different items on the subscription per this guide: https://docs.stripe.com/billing/subscriptions/multiple-products

Reasons:
  • Blacklisted phrase (1): this guide
  • Long answer (-1):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: archiverat