Stripe's price calculation info to the client app - stripe-payments

We have a lot of products in our dashboard; each product has just one price.
Each product's price has a graduated pricing model, so if users buy more units they pay less for each unit.
The only way we found to know how much users have to pay is to create the subscription for a given quantity of products so that the invoice will give us the amount.
Is there a way for extracting the graduated pricing ranges for sending it to the client app? We'd like to avoid creating a subscription to know the final price for the given number of units; also, we'd like to avoid replicating the pricing model's logic on our backend.

Related

Using the Stripe API to allow a free trial of a single product in a multi-product subscription

We have three products, small, medium and large. I'm using the Stripe API to charge customers on a prorated for each product they use every month.
I'd like new customers to be able to have a free 14 day trial of the first small product they add to their subscription.
Picture a VPS company allowing a free trial of their small VPS, but wanting to charge if a customer adds a medium and large one in the first month.
The problem I'm encountering is that free trials apply to all products in a subscription. If I use the trial_period_days attribute when creating a subscription or a checkout session, that applies to all products in that subscription for that month. i.e. customer adds a small product, then adds 100 large products, and receives all of them for free during the trial.
I've tried looking into coupons as an alternative, as in applying the cost of a small product to a customers subscription, but if they remove a product at any time from the subscription, the pro-rated refund excludes the coupon, and so the amount vanishes.
Is there any way to use the Stripe API to product the first product only with a free trial; while still only having one recurring 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).

Automatically adjust pricing to factor in Stripe processing fees

I have a website in which I use Stripe and its NodeJS SDK. In particular, I use the checkout feature.
The problem is this: I have a product and I want to earn, let's say, 100€ for each sold product. In this moment this is not possible, because when the user pays, I will have stripe's fees removed from the 100€.
Is there a way to specify: "this is the price that I want to earn, without the fees, the additional fees will be paid by the user"?
Or do I have to increase manually the price and adjust it so that after the fees it will result in 100€?
It’s not possible to do that automatically, you need to manually compute the amount that includes the Stripe fee. The formula to compute that amount is explained here.
However, note that:
You cannot really know the Stripe fees in advance when using Checkout, since they will change depending on the Payment Method used (for example cards in EU have a different fee than cards in the US). You can learn more about Stripe pricing here.
And in some jurisdictions, charging processing fees to your customers is prohibited by law (as explained in the first link I shared).
So instead of customizing the price to each charge, I would recommend to directly set the price to cover your own costs of doing business (including credit card processing fees). For example, charge your customers 102€ for your 100€ product.

Stripe Connect Fixed/Flat Fee based on value for Connected Accounts

I am creating a Stripe Connect marketplace which charges a fixed fee based on value of sales, e.g. up to £2500 of revenue (for a connected account in a calendar month) will incur a flat fee of £200 per month to the platform.
I have read the Stripe documentation but still quite unclear how I can achieve this using a Standard Connect account. I understand the concept behind adding a flat fee per transaction but my use case is based around the amount of revenue over a time period.
Any help is always appreciated.
it sounds like you want to keep track of the payments processed by your connected accounts in order to figure out what to charge them.
The best way to do this is probably to set up a Connect webhook and listen for events like charge.succeeded and keep a running total each month for each account.
You have a number of options for charging your accounts, but using Billing to create a subscription that you update as their revenue grows is probably the best experience. You could also use metered billing with pricing tiers based on the payments you track.
If you need to calculate historic revenue, you'd need to manually retrieve the payments and calculate the total for the month(s) you're interested in.
NOTE: For both the webhook events and the retrieval approaches you'd need to be aware of several different objects other than Charges that may affect revenue up or down, like PaymentIntents, Refunds, Disputes etc depending on the details of the connect account's integration.
Hope that helps!

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