#mxp_unexpected

1 messages · Page 1 of 1 (latest)

dark badgeBOT
#

đź‘‹ 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.

lilac matrix
#

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

shut goblet
#

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

lilac matrix
#

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 duration options
shut goblet
#

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...

lilac matrix
shut goblet
#

Ok the discount is pro-rated also... Is there a way to avoid this ?

lilac matrix
#

not really unfortunately, beyond disabling proration on the update or removing the coupon first and then adding it back after the update

shut goblet
#

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

lilac matrix
#

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

shut goblet
#

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

lilac matrix
shut goblet
#

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

lilac matrix