#johnroberts-invoice-urls
1 messages ยท Page 1 of 1 (latest)
johnroberts-invoice-urls
@halcyon elbow we don't really make any guarantee here. Even if it expired in X days right now it could be lowered later. We make it easy for the end customer to gain access back though if the URL expired by sending them a code via email
Thanks. When I went to a URL that had expired, I got a page referring me to my company's email address (the platform account) to get another URL. Does that mean we would get emails to request a new URL?
Not sure I understand what you are describing. Can you give me a concrete example?
which Invoice id is this for?
test mode
in_1M8urTFOtBDkom7gupPw1Xn2
Our use case is to send the customer an email with the link if we receive a payment_intent.payment_failed
okay so the docs are https://stripe.com/docs/invoicing/hosted-invoice-page#invoice-urls and cover this logic.
Was that Invoice sent via email before?
Not sure, I don't think so
I think that might be the issue, if you don't email invoices by default then there's no good recovery flow yet ๐ฆ
OK Thanks!
What happens if you retrieve the Invoice via the API. Do you not get a newer URL that works?
hahaha I was just typing the question -- can I just get the invoice from the API and will it have a fresh url
I will try
let me know if that works I'm curious now
It works! Woo!
ah perfect, so the main issue is that if you have cached a URL it might have expired by then and if you don't email invoices to customers by default the only recovery flow is for them to email you
so as long as you don't cache those URLs and get them fresh from the API when you want to email customers you should be fine
Yep. That works for me. Thank you very much
sure thing, thanks for bearing with me. I helped design this flow and I still got confused so we definitely can improve this a bit ๐
Our flow is to charge the invoice to the customer's default payment method, typically bank debit. If sometime later we get a payment_intent.payment_failed we email them with the hosted invoice URL at that time.
yeah that makes sense
We originally were using the invoice.payment_failed but the payment_intent.payment_failed has failure info.
The invoice.payment_failed payload has the hosted invoice URL but not failure info
yeah I think I'd used invoice.payment_failed and then go find the information I need from the underlying PaymentIntent and then decide next steps
OK, I'll look into doing it that way