6
votes

I've been reading through the docs all day and am having a hard time understanding if this is possible.

What I want is to subscribe a user to multiple plans and have it charged on a single invoice, with recurring payments monthly from when the invoice was originally billed.

In the docs it says:

"Note that multiple subscriptions on a customer results in a separate billing cycle, invoice, and charge for each subscription, even if the plans have the same billing interval and the subscriptions are created at the same time."

Which is not promising

But then the api explicitly allows for creating invoices with multiple items through the InvoiceItems api. It seems this is mostly for custom/unique actions on the customer, like applying discounts or one off charges outside of the regular subscription cycle.

I suppose I could manually keep track of billing cycles and manually create multi-item invoices, but I would much rather have this automated through Stripe.

Is this possible?

5

5 Answers

7
votes

What you are describing is now supported in the Stripe API: https://stripe.com/docs/subscriptions/multiplan. The idea is to add multiple plans to a subscription, a restriction being that all plans must share the same interval.

// Set your secret key: remember to change this to your live secret key in production
// See your keys here: https://dashboard.stripe.com/account/apikeys
var stripe = require("stripe")("xxxxxxxxxxxxxxx");

stripe.subscriptions.create({
  customer: "cus_91elFtZU3tt11g",
  items: [
    {
      plan: "basic-monthly",
    },
    {
      plan: "additional-license",
      quantity: 2,
    },
  ]
}, function(err, subscription) {
  // asynchronously called
});
3
votes

Each subscription would have its own invoice and charge on Stripe's end for each new billing cycle and there is no way to bundle all of those into one without some custom development.

If you want to group all subscriptions on a customer into one charge, the best solution would be to use Invoice Items. You'd create a $0 monthly plan for all of your customers and then, each month, when you get the invoice.created event indicating that a new invoice has been created you'd create one invoice item for each "subscription" you want to charge your customer for. Stripe would then charge the total amount at once for that invoice automatically.

2
votes

Yes you can add multiple plans to an existing subscription now. Below is the example:

sub = Stripe::Subscription.retrieve('sub_Aj4Wy1gzA5xyz')
sub.items = [{plan: "UserTestPlan"}, {plan: "UserTestPlan2"}]
sub.save
2
votes

2020 latest recommandations

Now, the recommanded workflow to handle that scenario is:

  • create product and prices instead of plans
  • create a subscription (with a price)
  • add as much subscriptionItem as needed to that subscription

Your customer can have has much subscriptionItems as needed. He will be billed once on the subscription recurring basis, and have only one invoice. It also handle if you add the subscriptionItem in the middle of a month.

stripe doc: Subscriptions with multiple products
Stripe API reference

// add item to existing subscription
await stripe.subscriptionItems.create({
    subscription: subscriptionId,
    price: priceId,
    quantity,
});
-1
votes

According to the docs you can add a quantity to the Subscription that will charge you multiples of the Plan amount but on the same invoice:

Stripe.api_key = "sk_test_BQokikJOvBiI2HlWgH4olfQ2"

Stripe::Subscription.create(
  :customer => "cus_4fdAW5ftNQow1a",
  :plan => "pro-monthly",
  :quantity => 5,
)

There's a full page of docs about it here