#petersaverman
1 messages ยท Page 1 of 1 (latest)
๐ happy to help
Hey!
would you mind sharing the request ID? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
Sure, just a minute
Just need to step back to a working piece of code. I've tried a lot of things. ๐
no worries
I have a hard time finding it... I see some logs but none of them is the one I made.
what's the subscription ID?
sub_1NzGd8HlcvrjsTX8cn8a4GLd
taking a look
Thank you!
I don't see any updates on that subscription
It's not an update, it's an upcoming invoice. Your colleague said that was how you could get a quote for how much your subscription would cost if you upgrade to a higher quantity/tier.
oh! ok
yeah sorry didn't see the upcoming
I thought you were updating
let me check the request now
No worries! Updating is the next step ๐
that's the one https://dashboard.stripe.com/test/logs/req_1cwyX7QNMTdhuE
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
would you mind sharing the result of that?
the response I mean
Sure!
As you can see from it, it ends up in two different lines. And instead of a recalculated amount I get the amount for a quantity of three (1 + 2).
this is for proration reasons
so basically you have a 3 lines
- first line which is the unused time of price1 with quantity 1 => amount (-x)
- second line the original price1 with quantity 1 => amount (y)
- third line the new price 1 with quantity 2 => amount (2y)
the total amount is 3y -x
Aah, of course, I get it now. So that is actually what the next period charge would be. I was expecting it to show me the additional charge that would be done if I opted in to add those extra two here and now. Is that done by adding a proration date set to now?
So that is actually what the next period charge would be
no that's showing you what the next invoice would be if you made the changes now
since there's something to be paid through this upgrade, we generate a new invoice and change the billing_cycle_anchor to now and do the prorations
But since the initial subscription cost was 49,99 and I then add two more, wouldn't the total be 99,98 and not 14.98 as the json says?
One is already payed for
To turn it around; how do I get an invoice that says "99,98" since that's what I am expecting two pay for the extra two for the upcoming month. Or is that not how it's done? I was expecting that and then another invoice in a months time that is 149,97
you're not accounting for the proration in your calculations
Then how do I do that?
let me just explain the upcoming invoice. basically your customer paid 49,99 for a month
let's say we're half way through the month
you call this upcoming invoice API and want to see what your customer has to pay for the rest of the month
Yup, I'm with you that far
But if I half way through the month want to raise the quantity to 3 (from 1). Can I then get that on the same invoice and see the difference in price right away (having payed for a sixth of the cost already)?
As in I want to pay for it straight away to get the higher quantity on my subscription
wait a second
Ok
let me finish first through my thought process then we can digress if you don't mind
Sure, sorry!
no worries, it's just that I want to make sure that we're on the same page
scratch that but since there's something that needs to be the billing_cycle anchor changes
the billing cycle doesn't change because it's the same price
so what will happen is that your customer paid 49.99 and you owe them 24.99 and now they will pay for 49.99 * 2 but for a half period
so they have to pay 49.99 * 2 / 2 = 49.99
Right, my code actually said 2. Thought it was 3.
So the issue remains, I guess? Why does it end up beeing tree line items and how do I display the correct amounts?
Can I set a new billing period start date manually? Or is it easier to just cancel the subscription, refund what's left of the payment and create and entirely new one?
Hi! I'm taking over from my colleague. Please, give me a moment to catch up.
Hey! Sure thing!
It it a separate question?
No, more a potential solution to my issue
Could you please summarise the issue for me?
We use subscriptions as a way for our customers to add users to their license. One subscription = one licenses seat/node. SO if they mid period want to add x amounts of people (say 5), how can I immediately charge for 5 half period subscriptions and on the next billing period have those new five subscriptions included in the normal billing. I was hoping for this to be easy but it looks like it's not the case.
You can update the total quantity of a SubscriptionItem and use proration_behavior: "always_invoice": https://stripe.com/docs/api/subscriptions/update#update_subscription-proration_behavior
Oh, it's that easy? I'll give that a go then. I need to run and pick up my kids now but I'll get back on it in an hour or so. Thank you!
Happy to help.