#xerusky_api
1 messages ¡ Page 1 of 1 (latest)
đ 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/1459190245445734451
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there, looking into this now
Is the request ID you provided a different example of a similar situation?
th reques id is for a similar example, i simplified the scenario in the Question section. The request shows a purchase of 20 usd with a discount of 4 usd and an upgrade to 57 usd, it is charging 41 but it should be chargin 37
Got it, let me take a close look at that specific example first
Okay, this is what I understand is happening with in_1Sng9T2e959zAvZld7l9IvHr:
- $16 was refunded from the previous price (originally $20 with a $4 coupon)
- $57 was charged for the new price (no coupon applied)
- The total is $57 - $16 = $41
The $4 discount was set to only apply once, which is why it didn't apply to the new $57 price
yea but the customer is loosing the discount because he is paying the 4 dolars in the upgrade
is there a way to maintain that discount when i make an upgrade ? another example suppose that i purchase the first subscription with a 6 month discount and the user makes an upgrade he looses the 6 month. If he want to make the upgrade in month 2 i would like to transfer the 4 months discount to the upgraded plan
can it be done ?
Yes, let me look into it
I think the most straightforward approach is to apply the coupon again when you update the subscription
https://docs.stripe.com/billing/subscriptions/coupons?dashboard-or-api=api#discount-subscriptions
Another possibility is to change the coupon duration so it can be applied more than once (but I don't think that's necessarily the right fit for your use case)
https://docs.stripe.com/billing/subscriptions/coupons?dashboard-or-api=api#coupon-duration
i tried to apply the coupon again but it resets it's duration for the 6 month's example.
Also i have a one time code fot the first purchase and is not working because the upgrade is not first time purchase.
So i am sensing that stripe does not support this discount transfer right ?
Right. Let me look into the options for this
I think the most straightforward option then is to make another coupon. My understanding is that you made a one-off coupon that was applied to the original $20 price, which was used up. Even though the price was refunded, that doesn't "undo" the application of that coupon. So you'll need another one-off coupon for the upgrade
i understand that but why when i make an upgrade the value for the proration is 16 when it should be 20, if i made a discount for 4 dolars why is he loosing that discount when making an upgrade ?
Because that proration generates a second payment, even though the payment is for a period of time covered by the original period, this is a second payment and the once coupon was fully redeemed with the first payment.
ok the second payment will take the first payment amount with discount applied but will not keep the discount so the upgrade will be charging the discount made and the remaining amount for the upgrade.
Also this behaviour will be the same if i have a coupon that makes a 6 month discount. I will make an upgrade, the discount of the coupon will be added to the invoice and the remaining months of discount will be lost ?
Correct, though I would only expect that for one-time discounts. In that case the discount is still a part of the calculation for what has already been paid, but it is used up so the new payment won't be discounted unless you apply the coupon again during your update.
For six month coupon that should be different though. I would expect that to apply unless the discount was otherwise removed from the subscription. Can you send me an example of that happening with the 6 month coupon?
Ok i understand what you are saying so if i make an upgrade i am loosing the discount unless i make another discount again, not directly but indirectly because i have to pay the difference as if i did not have the discount when the upgrade from 16 to 57 is made. To keep the discount the difference should be from 20 to 57 even though i paid 16.
For the six month i do not have an example but it is the same behavior if i make an upgrade i loose the discount and i should calculate the months remaining in the 6 month and apply them to the new upgraded subscription i guess right ?
You can do that but that could get pretty complicated. From my tests now, the 6 month coupon should still apply. We can still try to debug this and find if there is a bug on your side or our side, but otherwise your workaround could work.
ok let me try the six month and if i find any issues i will get back to you later because i did not test that.
And to close the subject on the one time it only applies to the first payment but if i make an upgrade i will loose it correct ? Because i paid 4 less usd in the first invoice but if i make the upgrade i will have to pay 4 more usd since the proration is made from 16 to 57 instead of 20 of 57
Correct, so if you want it to work for all payments during the first billing period it may make sense to give the coupon a duration that matches (like one month)