#ender_subscription-discount
1 messages ยท Page 1 of 1 (latest)
๐ 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.
Have you tried to set the duration_in_months to the corresponding period ?
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)?
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?
Yes I think so. But I strongly encourage you to test this using Stripe Test Clocks
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?
๐ taking over for my colleague. Let me catch up.
Sure! And thank you ๐
would you mind sharing the invoice where you don't see the discount applied?
ender_subscription-discount
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
what you shared is the subscription ID
and it has only one invoice for the current period
please use test clocks https://docs.stripe.com/billing/testing/test-clocks/simulate-subscriptions to advance time and see what the second invoice would look like
Oh yes, I was looking at the "upcoming_invoice" field
which shows it won't be discounted
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?
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?
correct
let me check the invoice give me a couple of minutes
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
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
no that's not possible