#Nick - convert invoice
1 messages ยท Page 1 of 1 (latest)
Thanks!
So you just want to put the invoices in a draft state to give the customers time to update their payment methods?
Just want to know why you want to do this exactly
Let me provide a bit of context
On Feb 10, I migrated all of our subscriptions from licensed pricing to metered pricing. That forced the billing_cycle_anchor to be Feb 10 -> March 10 (because the price is monthly).
We continued to report usage, but a requirement from our finance team is to have the billing period be the 1st to the 1st - so yesterday at 12AM UTC I tried to run billing_cycle_anchor=now to convert the balances up to that point into an invoice, and have the billing_cycle_anchor be reset back to the first
It worked fine for most of the subscriptions, but a few with bad payment methods (or lack thereof) received an error from Stripe, so now I'm not sure what to do
We've got our own retention mechanisms and such internally that will trigger
Just seems weird that Stripe's automated period change has no problem converting upcoming to draft/finalized regardless of credit card but API actions have different requirements?
Paying the invoices with the bad payment methods failed, so you want to mark an invoice that's past due back to draft?
Well that's the thing. The payment failed but it didn't generate an invoice
Can you share a sample subscription id?
You can see the 402 from the billing_cycle_anchor=now call here https://dashboard.stripe.com/logs/req_Xnsz3ef5eARtoS
So the billing_cycle_anchor didn't change and an invoice wasn't created, but a charge was
Almost seems like a chicken and an egg? How does the payment happen without an invoice?
Sorry for the delay here. Juggling some things
But if you retrieve the subscription, I believe the latest invoice object refers to the one generated on the 10th
When you did the update
Yeah so this is the latest invoice: https://dashboard.stripe.com/invoices/in_1KRf6qI67GP2qpb4iDZrmwQc
But there's a balance in the upcoming invoice
That upcoming invoice total is what Stripe tried to charge for. But when the charge failed, it just left the invoice in upcoming
https://dashboard.stripe.com/payments/pi_3KYJCLI67GP2qpb41aPHPU2A this is the payment. 12.42 - but no invoice attached to it
HI ๐ I'm stepping in for @uneven mauve . Gimme a second to get caught up
So in this case I'm pretty sure you'd want to reach out to the customer for each invoice and have them update their payment method.
But how would I do that if there is no invoice?
Like when the invoice.payment_failed webhook comes in, we send emails to the customer to do so
(update their payment method)
Can you share the most recent event ID?
There is no event, because the request failed https://dashboard.stripe.com/logs/req_Xnsz3ef5eARtoS
The last event in the dashboard is from Feb 11, the day I did the migration from licensed to metered
The invoice.payment_failed event did not trigger?
Correct
There was no invoice created. So I'd imagine that's why it didn't send the event
Okay...and that's due to the billing cycle anchor change attempting to trigger an automatic invoice, for which these customers did not have a valid payment method... ๐ค
So the only thing I can do is write off these invoices by clearing the usage and then resetting the billing cycle anchor
I think there should be other options. Let me keep digging
I'm trying to understand why the latest_invoice on that subscription had $0 as the amount
Because the latest_invoice is the one from Feb 10
Like if you look at the actual ID, that's what it points to, the invoice from when I changed price ID's from licensed to metered
(I believe it's from metered-migration > whatever actual price)
Okay, so there's currently no PI for these subs. You need the PI to request the customer update their payment method.
Alright so upon further review the underlying charges were declined. I can't go into more detail here but Support will be able to help you with these invoices.
https://support.stripe.com/contact/email