#simon_unexpected
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/1361958162256629861
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi! Do you have a subscription I can look at?
Is this still public chat?
But If i send you sub id, I guess no one else can take a look anyway correct?
sub_1QnJDlJzab8H3HyBEDt8Fa5G
Yeap
that would be the subscription where i noticed the problem
I am seeing the EUR 50 being deducted off the total of the first Invoice: in_1QnJDlJzab8H3HyBkEZukYw4
I am not seeing it being deducted in the second invoice: in_1RDjM8Jzab8H3HyBlBWg3u0g
Where do you see it exactly?
thats kinda my problem. it is only calculated for the unused price i marked yellow. Around 1/5 of the subscription is done, so I would expect the customer to get back (198 * 0.8=154 euros), but he only gets back (198-50) * 0.8 = 118
because stripe connects the voucher with the subscription payment. our idea is that the voucher is for the one-time payment in the beginning
The coupon is not scoped to a particular product. So that is why it applied to the entire subscription.
This is why you are seeing it impact the proration of the recurring item.
whats the solution to this? i dont want my customer to not book a small 30 euro subscription package because they risk loosing part of their 50 euro voucher
You can apply the coupon to a specific product: https://docs.stripe.com/api/coupons/create#create_coupon-applies_to-products
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
i guess i can only do this for new coupons. if i do it like this, the proration will work like i expect?
also, my current vouchers is used by more than 100 customers already. for all of them the described problem could still appear should they decide to upgrade their packages. whats the best practise here?
๐ taking over for my colleague. Let me catch up.
ill be afk for around 10 minutes
@dreamy zodiac I'm having trouble understanding the scenario. Let's forget the issue for a minute, would you mind explaining what is the expected behavior you're looking to implement?
- I need a voucher that makes a discount on a one-time payment that is set up together with a subscription. This voucher should not have any influence if I later do any changes to the subscription. Just for the first payment 50 Euros should be deducted and thats it, then we can forget about the voucher.
- I need a best practise solution how to fix my current situation with the customers that already used my current voucher
the coupon was configured to apply only once
so whether it applies on the invoice as a whole or on the one-time item it won't make any big of a difference unless the amount of the one-time item is less than 50 EUR
now as you mentioned, if the customer upgrades/downgrade their membership and proration is calculated the prorated amount will be calculated based upon the actually paid value of the subscription which in this case is affected by the coupon
you can always generate credit notes to make adjustments on the opened invoices https://docs.stripe.com/invoicing/integration/programmatic-credit-notes
so should i make this voucher permanent? but wouldnt this mean that the customer will get 50 euro discount every year when paying the subscription?
so should i make this voucher permanent?
no
for the customers that already used that coupon (41 times used) you need to use credit notes or customer balance to adjust the invoices
but from now on you should create a new coupon
that only applies on the one-time product
it's important to note in that case that the one-time and recurring prices should be on 2 different products otherwise this won't work since the coupon is tied to the product rather than the price objects
so, for the new coupon everything seems clear for me. regarding the customer balance/credit notes do i see this correctly, that I will need to implement the following functionality whenevery customer buys package upgrade:
- check if customer used voucher for this subcription in the last year (not sure yet how, but i guess it should be possible)
- calculate the percentage (p1) of how much time in this payment circle already passed (days since start / 365)
- calculate the money the customer "lost" (c_l) by the voucher only being valid from subscription start to current day (voucher_value * (1-p1))
- deduct c_l from customer balance/credit notes somehow
is that the correct idea?
you don't have to do that automatically to be honest
I mean you can run that as a one-time script for the customers that already used the coupon
and then delete the coupon
i will probably only run this for customers in the moment they want to upgrade right?
and just calculate the delta and based on that create accordingly a customer credit balance https://docs.stripe.com/invoicing/customer/balance
yeah only for customers that did or will upgrade before the end of the current cycle
okay. thanks for your help. i will talk to my bosses about it and will probably implement after easter. if there will be any questions during implementation can i reopen this thread?
can i reopen this thread?
no but don't worry when you create a new thread, this one will be referenced automatically
if it's not you can just send the link to this thread
okay thank you. have a good day!
same to you