Stripe subscription upgrading and downgrading. - stripe-payments

This question is for anyone who's experienced with Stripe. I've run into a situation that may be pretty specific, but I'm hoping I could get some help with. I am creating a system where a user can pick from many different options and set up a yearly subscription based on their selections. So there is no set plan cost, the subscription cost is variable.
Now, if someone creates a subscription for $100.00 dollars, then in a month decides next year they'd like to reduce their subscription to $50.00 they can do so. However, they will not receive a prorated refund due to the downgrade for the current subscription period. My issue is, let's say they change their mind and realize the $100.00 service is worth it. So much so they actually want to change their subscription from $50.00 to $120.00 in the current subscription year. I would like to charge them a prorated fee, but if I do that they will be charged for the difference of $50.00 and $120.00, not $100 (which they paid originally) and $120. Is there anything I can do to allow for such a situation to occur?

I'm thinking that in order to make this work I'll have to implement the calculation of a proration amount myself. So in the case a user pays for a $100 subscription, downgrades to $50, and then sometime later in the same year upgrades to $120.
The solution I see is to save the maximum amount they've paid for their subscription in my local database record. When they upgrade, if their new plan cost is greater than the maximum they've paid, I need to set their stripe subscription to the new amount without proration, then calculate the difference between the max they've paid and the new plan amount, prorate the cost and charge them manually using a stripe charge. Kind of a roundabout way to do it but it accomplishes the goal as far as I can see at the moment.

Related

Stripe Refund Prorated on Quantity of Days Subscriptions

My goal is this: sub service started to experience issues on 11/9. Instead of pausing payments immediately, I let a few weeks go by. I now want to refund the cost incurred to each user based on the prorated cost for the number of days of bad service. So refund each user 19 or 20 days based on their current subscription. Is there a way to do this via API?
It get's so complex with the past month's proration on the bill. It's a nightmare and this would save me so much time. Willing to compensate. Thank you.
I havent been able to try anything yet.
You can issue a partial refund by specifying an amount less than the original amount of the payment being refunded using the Stripe API. You would specify the payment_intent belonging to the Subscription Invoice in question (which you can find on the Invoice object).
However, you need to calculate the amount you wish to refund on your end based on the amount you want to refund for each Subscription.

Best way to model my mixed monthly/yearly subscription with Stripe payments

The subscription plan
I have a subscription plan available at my app which I need to model with Stripe.
The subscription plan details are the following:
A fixed amount of $20/month or $200/year (discounted) that the user must pay.
With the previous fixed amount the user can consume 2500 units of the product per month.
If the user consume more than 2500 units in one month every additional unit has a value of $0,01.
Examples
A user choose the subscription plan with the $20/month option and in the first month he/she consumes 2520 units.
The total amount to pay for the first month of the subscription for this user is:
$20 fixed amount
20 additional units * $0,01 = $0,2
Total to pay: $20 + $0,2 = $20,2
A user choose the subscription plan with the $200/year option. In the first month he/she consumes 500 units. In the second month he/she consumes 5000 units.
For the first month this user needs to pay:
$200 because is starting the subscription
No additional units.
Total to pay: $200
For the second month this user needs to pay:
No fixed amount because the fixed yearly quantity has already been paid.
2500 additional units * $0,01 = $25
Total to pay: $25
Problems
My biggest problem modeling this with Stripe payments is that is not possible to have prices with different intervals in the same subscription.
If the user chooses the yearly fixed price is not possible to create a subscription on Stripe that has a fixed yearly pay (of $200 in this case) and a monthly graduated price (for the additional consumed units).
I have seen that the subscription upsell feature is something very similar to what a I need. But once it's activated I can't find any way on the API to enable it when the subscription is created (I'm not using checkout).
I have seen also that it's possible to create two subscriptions, one for the yearly pay and another one for the monthly units. But creating two subscriptions make everything really difficult, you need to take into account two subscription states and callbacks are more difficult this way too.
Questions
What is the best and simple way to model this subscription plan using Stripe?
Note: I'm doing a custom integration with Stripe, so the subscriptions and customer are created via API. I'm not using Stripe checkout.
My biggest problem modeling this with Stripe payments is that is not possible to have prices with different intervals in the same subscription.
Indeed, you can't combine Price objects with different intervals on a single Subscription. Otherwise, this pricing is possible by combining a flat rate fee with metered usage as outlined here.
Your best option in cases where your customers elect for the annual fixed fee is to roll with a single usage based Price and amend the initial invoice to include that a one-off Invoice Item for the annual fixed fee.
I have seen that the subscription upsell feature is something very similar to what a I need. But once it's activated I can't find any way on the API to enable it when the subscription is created (I'm not using checkout).
Subscription upsells are a Checkout only feature right now. However this is not really related to the problem you're facing (it just provides a UI for your customers to upgrade to an annual Price for the same Product).

How to reset monthly SaaS usage on an annual Stripe plan?

I am currently in the process of creating the billing system for my first SaaS. A simple tool to generate videos. There will be a free, mid, and pro tier. The main difference will be the number of minutes you can generate per month.
I created 3 Stripe products for the tiers. The free product consists of one price ($0) with a monthly charge interval. The mid and pro tier consists of 2 prices, a monthly and annual charge interval.
When a user signs up for an account, my backend automatically creates a Stripe customer and subscribe it to a free plan. A user can upgrade their account to a mid or pro tier. The plan will be downgraded to a free tier when the user cancels or if the payment failed.
I reset the number of available render minutes after each successful payment, at the start of the billing month. I do this by listening to the successful payment Stripe webhooks. Even when the user is on the free tier, the webhook still gets fired since it is a plan.
The problem is that this method would not work for annual plans.
Which made me think that the method that I went for may not be the correct one.
Do you know if this is a good method if there is a better one and if there is a workaround for annual subscriptions?
Thank you very much for your time.
I think for the annual billing you'll likely want to just set up a cron job or similar that runs daily, and that looks at which annual subscriptions' 'billing day anniversary' (i.e., billing date is Aug 7, so billing day anniversary is the 7th of each month) and resets the counts - unless it is the billing date, in which case leave it to your webhook.

Stripe - Subscription vs Paying it all up front for a year

Say we've setup a Stripe Subscription plan. i.e. $30/mo. (Note: the billing/account info is stored on Stripe.)
Let's say we want to offer the option to the customer to buy a year of the service upfront, and if they do, they only pay $25/mo (i.e. $300).
Is there any way to conceptually link the "paid upfront" payment, and the Subscription plan? There'll related, except the second one is simply being paid up front, and at a discount because of it.
Or is the second situation simply an unrelated charge to the setup plan/subscription, and just submitted as a charge object?
(I want to make sure I'm organizing payments in Stripe the best way).
There's no universal "best way", it's up to you to decide which way is best suited for your application.
The simplest way, API-wise, would be to create a one-off charge for the yearly amount. But it is then up to you to track that the customer has paid for an entire year and should have access to your service during that time (if that's applicable to your business model).
If you'd rather have the customer being tracked as a subscriber on Stripe's end, what you can do is set up another plan for the correct amount and interval (i.e. $250/year).
Then, when a new customer signs up for this offer, you would:
subscribe them to the plan (this will immediately charge the customer for the $250 periodic amount)
immediately cancel the subscription with at_period_end set to true. This will prevent the customer from being billed again in one year, but will leave the subscription active until then.

Google wallet annual recurring subscriptions?

According to the documentation Google Wallet seems to only support monthly recurring subscriptions.
I'd to charge users annually for the use of an application hosted on AppEngine (purely to be able to offer the user a better price and reduce administrative costs). Are there any plans to support annually recurring subscriptions?
Or is there a way to configure the current subscription system to behave as an annual subscription system?
Technically there's no way to configure an annual subscription. But I suppose you can work around it: Request an initial payment for the entire first year and then a monthly-recurring payment at a discount.
For example, suppose you offer a monthly plan that costs $100. And you want to offer an annual plan for $900 (25% discount). Instead, you may offer an initial payment of $900 followed by 36 monthly-recurring payments of $75.
What this means for your business is that once a user has paid for and used your service for an entire year then you start treating her as a "loyal customer" and let her keep paying the discount price without committing for another year.
Wallet for Digital Goods currently only supports a monthly frequency for subscriptions.
https://developers.google.com/commerce/wallet/digital/docs/jsreference#jwt
there is no official solution for an annual subscription, but you could implement a solution similar to what #oferei or #EdSF suggested in their posts.

Resources