#sarcasm_api

1 messages ยท Page 1 of 1 (latest)

midnight falconBOT
#

๐Ÿ‘‹ Welcome to your new thread!

โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).

โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.

๐Ÿ”— This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1247479411683491851

๐Ÿ“ Have more to share? Add details, code, screenshots, videos, etc. below.

sharp relic
#

๐Ÿ‘‹ happy to help

robust briar
#

Hello

sharp relic
#

looking at the subscription please give me a moment

robust briar
#

My guess is that it's happening because the unused phase started before the creation of the discount and these items preexist.

#

When we are making the migration to the new item prices, we use the 'proration_behavior' => 'none'

sharp relic
#

sorry, please give me a moment I still didn't have the chance to look at this

robust briar
#

There's a typo at my message. It should write:
After the migration, when increasing the quantity of the subscription item and use the 'always_invoice' option for the proration, the "unused" invoice line is computed without the discount, resulting to a credit balance.

sharp relic
#

I'm having trouble figuring out what you would expect in each step

#

would you mind sharing a small example please?

robust briar
#

Of course

#

When this subscription started, the invoice correctly looked like this

#

One single item for a month that costs $25

sharp relic
#

ok perfect

robust briar
#

After that we changed the subscription item to a different one, with quantity 4 and added a coupon that resulted to the next invoice being also $25

#

Which was also correct.

#

Then through our app, we increased the item quantity to 5

#

With "always_invoice" proration

#

Which resulted to this

robust briar
#

What do you mean?

sharp relic
#

ok let me go back and send you each invoice ID for each action

#

in_1PNeXGJ3ZSOORD28KEHBuWGe is the creation invoice

#

the one you shared

#

in_1PNrI2J3ZSOORD28oEJvU0D3 is the one where you change the price and qty to 4

#

this resulted in a -$40.75 credit balance to the customer

robust briar
#

We just changed the quantity at the second invoice

#

Between the first and second invoice, we changed the subscription item with proration_behaviour = none

#

It was this event evt_1PNr5XJ3ZSOORD28XPYUNiQQ

sharp relic
#

oh so there was no invoice that was created ๐Ÿคฆ

robust briar
#

And this Log ID req_Se5B91a959p6Gm

#

We do not want an invoice to be created at this point. We need this to be done seemlessly to our customers

sharp relic
#

yes but without prorations you're saying that your customer has access to the 4 * 18$ subscription price without paying anything in return

#

but then we you do apply the next change you're saying "now do prorations"

robust briar
#

But at the same time we add a coupon that would limit this to a $25 total

sharp relic
#

which will be calculated based on the 4*18 price rather than the 25

sharp relic
#

since you didn't generate any invoice

robust briar
#

So in order to do this, we have to do proration

#

That's what I thought

sharp relic
#

that's why you should have done the proration and invoice the first change

sharp relic
#

if you want you can use test clocks to simulate the subscription advancing in time

#

so you don't have to wait till the next day to perform your different tests

robust briar
#

I didn't wait, I just created the first subscription at the end of my work day ๐Ÿคฃ

sharp relic
#

yes but regardless just giving you an alternative here

robust briar
#

Yeah, I know and I've been using them. Thanks though!

sharp relic
#

sure let me know if you need any more help

robust briar
#

Thank you!