#syed7280_best-practices

1 messages ¡ Page 1 of 1 (latest)

strong ingotBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always 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/1263677545493172277

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

scenic zealot
#

For clarifying, you do not want to modify the coupon to the specific discount amount instead of 20%? ie. a fixed coupon of $24 * 9 months = $216 ?

versed smelt
#

I could, but the date it will be valid until can be dynamic. E.g it might be 3 months in the future, it can be 2 years in the future

#

Its based of a students graduation date, so the discount I am providing is for students. They need to provide an Enrolment Confirmation Letter from their uni so we can 1) ensure they are a student, and 2) see when they will be a student until, to determin when the discount should be applied until

#

I do have one solution, but not sure if there is something more simpler:

I can add an invoice item, for the remaining amount to the Subscription via a subscription schedule phase, and get it to be invoiced immediately

scenic zealot
#

Okie, but what happen if in Sep30 you just make an Update Subscription API to unset the coupons

#

(or the Subscription Schedule to unset it at the time)

versed smelt
#

I am not sure what behaviour that causes, will it cause a proration?

scenic zealot
#

You can turn proration_behavior off. (Let's just try it in Test mode, and using Test clock to advance the time)

versed smelt
#

yeah I might quickly test it in the dashboard now

versed smelt
#

yeah it didnt work as expected

#

I tried both with no proration, and charge immediately

#

It didnt generate an invoice for the remaining undiscounted amount

scenic zealot
#

Thanks for trying, and yeah I suppose it's not that straighforward :/ I guess the only option is to manually generate an additional invoice item as you mentioned there. This is trickly because API-wise it's an annual Sub, while actually you want to calculate by monthly

versed smelt
#

lol yeah, the issue only comes above when when the user chooses annual subscription over monthly. because with monthly, I can just remove the discount and the next invoice will get generated accordinly