Stripe: How can I create a non-renewable subscription plan? - node.js

We would like to have a yearly plan for our service, but legally we cannot automatically-renew our customer's yearly plan. We need to communicate with our customers in a timely manner within the weeks leading up to the end of their yearly plan so that they will manually purchase another year. (this is a legal thing). So we need some method of setting up a Stripe subscription plan that will either not auto-renew, or that we can cancel via API when we're informed via a webhook that their subscription's year is about to end.
Has anyone had any luck with any creative ways of setting up a non-renewable yearly subscription plan with Stripe? Trying to avoid needing to setup a cron job that hits Stripe everyday to find subscriptions that need to be cancelled.
After contacting Stripe support, there's not an "official" way to do so.
One thought I had was to setup a custom subscription plan of 10 days with a 355 day trial period. That way I could set a webhook to trigger based on the customer.subscription.trial_will_end event.
I'm doing this with the node.js Stripe module.

Well, you could set up a $0.00 subscription, and then a listener for invoice.created webhook, and use that to trigger a flow where you inform the user that their invoice is due, and direct them to a page where they can 'approve' the payment. When they approve it, you could then just create a good old fashioned Charge to collect the money.
Basically, use Stripe as your cron job, and do the actual Charge creation separately.

Related

How can you pre-auth a subscription payment with stripe (after the first payment)

I know I can pre-auth a stripe subscription with a trial period. I want to pre-auth the 2nd, 3rd, 4th, nth subscription payment. The info we are sending out is time critical and if their subscription lapses due to NSF or something else, it would be nice for them if they could rectify the problem BEFORE it lapses.
There is a pending invoice you can get for a subscription, and you can create a payment intent with an invoice ID so that when the invoice is paid, the payment intent (that captured the money) will be used to collect the money. BUT the pending invoice doesn't have an ID until one or 2 hours before they try to collect the money which is 3-4 days too late.
Has anyone figured out how to pre-auth subscription payments other than the first one?
Is there a subscription engine I could use (with stripe/paypal/venmo) that would mean I could quit using the deficient stripe subscription system?
Subscription invoices don't exist until the renewal of the billing cycle, and the underlying payment intent is created by the invoice. It's not supported to "pre-auth" subscription payments. Instead, you need to handle payment failures when those occur, optionally by letting Stripe handle that for you.
If you want to have successful payment in advance of some time-sensitive event, then I'd suggest one of two alternatives:
Shift your billing cycle to invoice 3-4 days ahead of what you have set now, allowing you time to recover from payment failures before the delivery timing.
Alternatively you would implement your own recurring payments using saved payment details. You would similarly want to authorize the payment ahead of time to allow for recovery. You could optionally use manual capture to defer capture until the time of delivery.

How to implement free plans in Stripe

To implement a free plan for a subscription, I have created a plan with a monthly charge of $0.
Is this the correct way to subscribe users to a free plan so that they don't have to pay?
Will users still get invoices when they are subscribed to a free plan? If so, how can I avoid sending invoices to those subscribed to the free plan?
Stripe Subscriptions are designed to manage billing and payments, rather than "tracking who is using a product". An "active" Subscription in Stripe is one that is being paid for, rather than one that is "being actively used".
You could conceivably set up a Subscription with an indefinite free trial, but really, you're doing a bunch of work to keep updating it to "remain free". I'd suggest taking a look at what you are actually trying to accomplish, because you're probably trying to track a user of your services, rather than track that a user doesn't pay you anything.
If you want to track a subscription with a zero plan on Stripe it will of course work. I use zero plans all the time.
All the invoices will be generated each month but will have a zero value which means they will automatically be marked as paid.
Invoice was finalized and automatically marked as paid because the amount due was 0.00kr
I am using custom accounts with custom integration so there is no automatic email going out from stripe for me, but I do receive the entire stack of events like I would any normal invoice which i have to deal with.
The event progression is: Invoice created -> finalized -> paid -> changed. Although instant the webhook events all come in.
There is no issue with zero plans, everything shows up in the Stripe admin and works just like any subscription. You can start out with a free plan and upgrade them later - the payment information is gathered and can be charged later so it is all good.

Handling a 2-year subscription in Stripe

I need to be able to handle two types of subscriptions that Stripe doesn't seem to support out of the box:
A lifetime subscription
A two-year subscription
Lifetime subscription is easy. I'll just create a single charge and be done with it. It would've been nice to have a subscription record that I could check for validity.
Two-year subscription is where I am not sure what to do. I figure I'd create a one year subscription (current max in Stripe) and will have to use web hooks for when a new invoice will be generated. What would be the proper way of cancelling an upcoming charge? I am also worried that customers will receive an email alerting them for an upcoming charge in the middle of the period. Any way to avoid this?
Thanks in advance!
Stripe's subscriptions do not have a set end date. The 1 year maximum that you mention is the maximum interval, i.e. the frequency at which the customer will be billed.
If you want to end a subscription after a set number of payments, your best bet is to use webhooks to count the number of successful payments (via the invoice.payment_succeeded events) and cancel the subscription when the desired number of payments has been reached.
Stripe does not send emails to customers about upcoming charges. It can optionally send email receipts after a charge is created, but you can disable this from your dashboard.

Can you set a l limited time period for a Stripe plan?

We are writing a Saas application that users will only use for 10 months. Is there a way to define in the payplan API to limit the number of payments to take from the customer?
I have spent some time looking over the API but I just can't see it. Perhaps I'm just overlooking it.
Stripe's subscriptions will always charge indefinitely by default so you'd need some custom development to cancel the subscription after a certain number of payments. The solution would be to use webhooks to be notified about events that happen in your Stripe account.
If you listen for the invoice.payment_succeeded event you can count how many times your customer has paid and then cancel the subscription when you want to stop the payments.
Now we can use a subscription schedule and set the phases.iterations
property: https://stripe.com/docs/api/subscription_schedules/create#create_subscription_schedule-phases-iterations
And set the end_behavior to "cancel"
Here's the full guide: https://stripe.com/docs/billing/subscriptions/subscription-schedules

Set end date when setting up Stripe subscription

In my application users are subscribed (and billed) each month for 24 months. Is there any way to have Stripe automatically end the subscription after the 24th month when I initially create the subscription?
What you describe is possible in Stripe, but not as an out-of-the-box solution (as of August 2014). You'll need a little bit of programming logic on your end, too.
First, you'll need to have a web hooks endpoint:
https://stripe.com/docs/webhooks
Next, you'll want to subscribe the customer to a plan like normal. We'll notify your site, via the web hooks, of when payments are made on a recurring subscription. Specifically, you'll want to watch for invoice.payment_succeeded events:
https://stripe.com/docs/api#event_types
Once a specific customer has hit the right number of payments (which you'll track on your end), you'd then issue a cancel subscription request:
https://stripe.com/docs/api#cancel_subscription
Hope that helps!
Larry
PS I work on Support at Stripe.
2020 Update
It is possible by setting up "cancel_at" date when creating subscription. More info Create a subscription with Stripe
Ya it can be done simply by passing "cancel_at_period_end" is true while creating subscription . Then subscription will automatically get cancelled on subscription end date

Resources