#shnikola_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/1448322495672353044
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there! Juggling a couple of threads, looking into this now
Can you send me the discount ID that you expected to see?
Hi there taking over
So this is because of what's described here: https://docs.stripe.com/billing/subscriptions/prorations#prorations-and-discounts
Discounts applied to an invoice containing prorations are only applied to invoice items and invoice line items that aren’t prorations
Hi there
do you have any suggestions on how to figure out that the proration has a discounted product, and with which discount?
sorry, I mean for my usecase - I need to go through historical invoices and see which ones were affected by discounts. The invoice I sent as an example involved a user who updated subscription to another product and applied a discount to it.
The discounted price of the new subscription was used in calculating the proration
The next invoice the user is going to receieve will be in a year, but they have used the discount
so I would like to be able to somehow recognize this scenario - a discount has been used for an upgrade
does that make sense?
The easiest way would be to keep track of this on your end (ie record in your database when a discount is applied). Or listen to subscription.updated events to keep track of when discounts are added or removed
But the discount isn't applied to the prorated invoice, so you can't just look at it and tell