How to merge old subscription with new subscription in stripe? - stripe-payments

Earlier, We have separate subscription for every products. And we came to know that we can create single subscription with multiple product by creating subscription with subscription items. Now we need to combine old subscription with new subscription's item. Is there any way to achieve this?

You can always update existing subscriptions with new items. You don't have to worry about old items on that subscription since this API will create new items and add them to that subscription.
On the other hand, if you pass the id of an existing item, you will be able to update its price as described in this Stripe guide.
With this in mind, I would recommend you updating one of the subscriptions to add new items with Prices from the other subscription. Note that there are many options in Stripe for how or if to prorate and charge for the changes to the two subscriptions, so be sure to experiment in test mode to find what matches your needs.

Related

Stripe Customer Portal - show specific subscription

I have one Stripe Customer, that attached to many companies into my project. Every company has its own subscription. So one Customer has many Subscriptions.
But during manage subscriptions on Customer Portal page I want to see just one subscription related to company (for now I see all Subscriptions related to the Customer).
Is there way (param) to show just one subscription related to specific Company (maybe by its ID) on Customer Portal page?
It's not possible right now to restrict the subscriptions managed in a Customer Portal session. You pass the customer parameter on creation and all subscriptions associated to that Customer object are manageable.

Is it possible to alter a recurring price that an existing customer is charged with Stripe API?

If an Express Connect Account holder creates a Product with a Recurring Price of say $10/month. And a customer signs up for this, a Subscription is created and Stripe will automatically bill the customer $10/month until they cancel. So here is my question...if the Connect Account holder wants to increase their Price from $10/month to say $12/month...can they do this such that the price increase will be billed to existing customers as well as new customers? I am thinking of an example where the Connected Account has say 100 existing subscribers, so manually changing each one, doesn't really work. Looking for something automated. From what I have read, it seems, that only new customers will see the new $12/month Price, and existing customers will see the original $10/month price until they cancel. Is this correct? Seems odd that Stripe would have no way of allowing Connect Account holders a way to increase their recurring Prices for existing users. I get they can create a new price..and hope users voluntarily switch to the new high price, but that seems odd.
You would want to think Subscription as per-customer object. Let's say you have 100 existing Customers already subscribed to a $10 monthly plan, there are 100 existing Subscriptions object, tights to each of those Customers.
Now if the Connected Account created a new price of $12/month, all new Customers will subscribe to this new price, and create separated new Subscription objects.
If you want to upgrade the currently existing Subscriptions, you would need to update each of them, changing the old price to the new price, by Stripe's Subscription Update API. Make sure to read the note about Proration, or refer to Proration Doc

Is there a way to bulk process customer data in Stripe?

I have a long list of old customers (>10K) in Stripe for which I would like to give a new trial period. Is there a way to bulk process those or we have to do that manually one by one?
I guess this depends entirely on what exactly you mean by 'new trial'. Do these customers have pre-existing Stripe subscriptions?
There's really no way to do this via the dashboard. However if there are no pre-existing subscriptions, you could programmatically create subscriptions for each customer object accordingly. You can specify the trial period on the price or on a per subscription basis.
As there are no batch endpoints for these operations, please be wary of the rate limiting if working with the API in this way

Allow for different customer to pay for a Stripe Subscription

I am working with Stripe to manage subscriptions. I would like to delegate payment of a subscription to another customer.
Specifically, I want the customer of the subscription to reap the benefits of a subscription, but assign another customer to pay for it.
Is that possible? If not, what are the possible workarounds? Thanks.
Notes:
Once a subscription is created, an invoice is automatically generated and is not editable according to what I have tried previously
I would like to keep as close to the usual subscription flows as possible, as I don't want to lose out on things such as being able to pro-rate an invoice (which becomes messy if I have to manually craft invoices myself)

Stripe Subscriptions - Create even if first billing attempt fails

On Stripe's API docs the value returned when attempting to create a subscription on a customer is described as follows:
The newly created subscription object if the call succeeded. If the customer has no card or the attempted charge fails, this call returns an error (unless the specified plan is free or has a trial period).
From this, I am assuming that if the first attempted charge fails (and an error is returned) this means that the subscription has not been created?
I am wanting to be able to create subscriptions on customers who may not yet have any billing sources added and as soon as they add a billing source the first payment will be processed. Is there a way to accomplish this?
From this, I am assuming that if the first attempted charge fails (and an error is returned) this means that the subscription has not been created?
Yes, that's correct.
I am wanting to be able to create subscriptions on customers who may not yet have any billing sources added and as soon as they add a billing source the first payment will be processed. Is there a way to accomplish this?
You could create a subscription with a plan for $0, or create a sub with a trial using trial_end to create a 'free' subscription.
As far as "as soon as they add a billing source the first payment will be processed." -- you'd need to create logic to handle this on your own. When a user adds a payment source you could update their subscription ending the trial (trial_end=now), or moving them to a paid plan.
https://stripe.com/docs/api#update_subscription

Resources