#petersaverman

1 messages ยท Page 1 of 1 (latest)

fiery wolfBOT
heady steppe
#

๐Ÿ‘‹ happy to help

tulip kelp
#

Hey!

heady steppe
tulip kelp
#

Sure, just a minute

#

Just need to step back to a working piece of code. I've tried a lot of things. ๐Ÿ™‚

heady steppe
#

no worries

tulip kelp
#

I have a hard time finding it... I see some logs but none of them is the one I made.

heady steppe
#

what's the subscription ID?

tulip kelp
#

sub_1NzGd8HlcvrjsTX8cn8a4GLd

heady steppe
#

taking a look

tulip kelp
#

Thank you!

heady steppe
#

I don't see any updates on that subscription

tulip kelp
#

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.

heady steppe
#

oh! ok

#

yeah sorry didn't see the upcoming

#

I thought you were updating

#

let me check the request now

tulip kelp
#

No worries! Updating is the next step ๐Ÿ˜‰

heady steppe
#

would you mind sharing the result of that?

#

the response I mean

tulip kelp
#

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).

heady steppe
#

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
tulip kelp
#

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?

heady steppe
#

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

tulip kelp
#

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

heady steppe
#

you're not accounting for the proration in your calculations

tulip kelp
#

Then how do I do that?

heady steppe
#

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

tulip kelp
#

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

heady steppe
#

wait a second

tulip kelp
#

Ok

heady steppe
#

let me finish first through my thought process then we can digress if you don't mind

tulip kelp
#

Sure, sorry!

heady steppe
#

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

tulip kelp
#

Yes, I'd expect that

#

And for the next one to be 49.99 * 3

heady steppe
#

no it would be 49.99 * 2

#

you're not adding, you're replacing the quantity

tulip kelp
#

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?

hot canopy
#

Hi! I'm taking over from my colleague. Please, give me a moment to catch up.

tulip kelp
#

Hey! Sure thing!

tulip kelp
#

No, more a potential solution to my issue

hot canopy
#

Could you please summarise the issue for me?

tulip kelp
#

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.

hot canopy
tulip kelp
#

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!

hot canopy
#

Happy to help.