#mxp_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/1326178243430060062
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
hi! if the proration generates an invoice then the coupon will get applied to that yes.
beyond that I'd need to look at a specific sub_xxx example where this happened to understand what the coupon getting lost/burned is about
Ok, the thing is the coupon line in the proration invoice is set to 0
Here the subscription : https://dashboard.stripe.com/subscriptions/sub_1Oetw6G5vg1joAgfRAmsoNYN
The coupons : https://dashboard.stripe.com/coupons/fO6aP3PJ
The proration invoice: https://dashboard.stripe.com/invoices/in_1Qbm1yG5vg1joAgfZQCI0dNE
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
thanks! this all seems normal, it's a duration: "once" coupon, it was applied to the Invoice that was generated, so now the coupon is consumed
if you want to avoid this there are options like
- disable proration on the update
- detect when this happens and re-add the coupon back to the subscription afterwards
- use a coupon with different
durationoptions
I'm not sure to see where it applied ? On the invoice the line is a 0 is it normal ?
Oh is see the (with 37.25 off) mention on the first item...
there is this event for example : https://dashboard.stripe.com/events/evt_1Qbm21G5vg1joAgfFTRN9ek6
and yes with proration the discount gets applied to the proration when it's calculated rather than being applied to the subtotal, which can be a bit confusing
https://docs.stripe.com/billing/subscriptions/prorations#prorations-and-discounts
Ok the discount is pro-rated also... Is there a way to avoid this ?
not really unfortunately, beyond disabling proration on the update or removing the coupon first and then adding it back after the update
Ok thank you for your help
Oh another question on that subject
If I try to generate the coupons the 1st of the month before the invoice subscription is generated, it should work ?
I see the the invoice start being generated at 1:00 Europe/Paris time
that could work but seems a bit tricky to be completely confident in it.
the invoices generate at the current_period_end timestamp of the Subscription, which is influenced by the billing_cycle_anchor
depending on your use case duration_in_months:1 on the coupon might make more sense, as that way it applies to all invoices geneated within the valid duration of one month
Ok I'll try that, because we specifically started every invoice on the first
Do we receive an event before an invoice is generated ? That could be a trigger too
no, you recieve invoice.created when it's created. At that point though you can add add a negative invoice item though(rather than a coupon) — https://docs.stripe.com/billing/invoices/subscription#adding-draft-invoice-items which might be another option
Yes I look at this option too (but we prefer to bee sure that it is not refundable), I see an event invoice.upcoming in the workbench with this description
Occurs X number of days before a subscription is scheduled to create an invoice that is automatically charged—where X is determined by your subscriptions settings. Note: The received Invoice object will not have an invoice ID.
But I cannot find the corresponding settings
https://dashboard.stripe.com/settings/billing/automatic "Upcoming renewal events"