#ender_subscription-discount

1 messages ยท Page 1 of 1 (latest)

lone riverBOT
#

๐Ÿ‘‹ 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/1252575599046688851

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

drowsy burrow
#

Have you tried to set the duration_in_months to the corresponding period ?

civic wolf
#

Yes! First of all, does duration_in_months refer to actual months (all invoices during those months will be discounted) or rather periods (N amount of invoices will have the discount applied to them)?

civic wolf
#

Right, so if I apply a coupon with

#

duration_in_months = 2

#

to an annual membership

#

the expected behaviour is that just the first year (first invoice) will have the discount applied to?

drowsy burrow
#

Yes I think so. But I strongly encourage you to test this using Stripe Test Clocks

lone riverBOT
civic wolf
#

Perfect! However we found that if we apply a coupon with

#

duration_in_months = 1

#

to a weekly membership

#

we expected 4 invoices to have the discount on them

#

however, only the first one had the discount on them

#

same happened with

#

duration_in_months=2

#

perhaps it has something to do with the subscription billing period being smaller than a single month?

rare yoke
#

๐Ÿ‘‹ taking over for my colleague. Let me catch up.

civic wolf
#

Sure! And thank you ๐Ÿ˜„

rare yoke
#

would you mind sharing the invoice where you don't see the discount applied?

lone riverBOT
#

ender_subscription-discount

civic wolf
#

Of course! Just one sec

#

sub_1PSzFuEsIU1Kk7mL7na9rc7x

#

We expect this invoice to have a discount on

#

This is the previous invoice

#

in_1PSzFuEsIU1Kk7mLJH4Js6TZ, with a discount

rare yoke
#

what you shared is the subscription ID

#

and it has only one invoice for the current period

civic wolf
#

Oh yes, I was looking at the "upcoming_invoice" field

#

which shows it won't be discounted

lone riverBOT
rare yoke
#

upcoming might be inaccurate sometimes

#

would you mind testing with test clocks and if it's still the case we could then look at the generated invoice?

civic wolf
#

Yes, give me one sec

#

in_1PSztIEsIU1Kk7mLX14LZFvu

#

Here's the invoice after the simulation

#

(Love the test clocks btw, they are super useful)

#

I believe the issue lies on whether the coupon is configured with "One time" or "Duration_in_months = 1" which is not the same

#

However if that's the case, which seems likely, how would we go about applying a discount for 2 periods on a weekly subscription?

rare yoke
#

let me check the invoice give me a couple of minutes

civic wolf
#

of course

#

we don't really know how to approach it since we can't use .5 months or so, since it's a nullable integer

rare yoke
#

you've set the duration once for this coupon

#

so you either pass 4 (for 4 weeks) or you can pass duration_in_months=1 and that means the subscription will get a 4weeks + xdays prorated on the 5th invoice

civic wolf
#

yeah

#

but is there any way to give a discount for 2 weeks?

rare yoke
#

no that's not possible

civic wolf
#

alright

#

then thanks a lot, you solved all of my doubts!