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:
const customer = await stripe.customers.create();
const setupIntent = await stripe.setupIntents.create({
customer: customer.id,
usage: "off_session"
});
Collect and confirm the payment details on the frontend using Stripe Elements
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
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