#ironbeard_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/1471528437599572132
π Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi π taking a look
Do you happen to have the ID of the related Invoice object? I'm trying to pull it from the page but am not having luck so far.
Thank you, digging in
(it's a different URL from the first one)
Oh weird, that second one at least has a recovery flow
I don't think I've seen this behavior before, but am looking for anything internally that may explain how this works.
ID for the first one: in_1PaOooCoTIfwbn28XBiqtx3Z
Ah, let me see if this checks out with your examples:
Invoice URLs expire 30 days after the due date. If the invoice doesnβt have a due date, the invoice expires 30 days after it finalizes. In all cases, the expiration window is never longer than 120 days.
https://docs.stripe.com/invoicing/hosted-invoice-page#invoice-urls
yeah, these are older invoices
okay, interesting. As an alternative, what I actually need is the "Pay online" URL in the invoice pdf. Is there a way for me to get that based on an invoice id / other fields?
(and does that expire?)
idk if this will work, but I'm looking to provide a customer a link to e.g. this page: https://invoice.stripe.com/i/acct_1Rb39DE3d1saT86k/test_YWNjdF8xUmIzOURFM2Qxc2FUODZrLF9UeGZxaE9vdW9QSVJxRGdYNUdyRmJmTVpRemhrUW9NLDE2MTQ1MTAzOQ0200HEAm7qCC?s=pd
Wait, are we looking at the same fields π
you mentioned invoice_pdf and I think I incorrectly read that as the hosted_invoice_url field which might be what you're looking for.
Well, originally I was using invoice_pdf in an existing impl, I didn't realize hosted_invoice_url was a thing
but yes, I think you're right
Gotcha, haha my bad, I think we still got to where we needed to go though
Great! π
- do you know if this expires?
- if someone's subscriptional rewewal invoice doesn't finalize because their card expired, would
hosted_invoice_urlallow them to pay for the subscription's invoice in a way that would use the new card details the following period? (I don't really care if they're stored as separate PMs on stripe's end vs just updating the PM's exp date etc).
(just looked at hosted_invoice_url for the old invoice with the expired pdf, and it looks like it still works!)
They do expire, that's actually what the expiration limits I found earlier are referring to. The renewal Invoice should still finalize, but its payment will fail. I don't think the Hosted Invoice Page inherently sets up payment methods for future usage, but I would need to test to be sure.
Oh, just found another interesting tidbit about the PDF links:
While expired URLs normally redirect (302) to a recovery page, PDF download URLs are an exception. If Stripe detects that a non-browser client (for example, cURL) has requested PDF download URLs, we return a 400 error with a URL expired body response. This allows integrations to more easily detect when an invoice URL has expired, and to retrieve a new working URL by re-requesting the invoice or credit note resource.
oh, interesting.
Well, I'm hoping to simplify my integration by allowing customers to pay open invoices through a link on their (self hosted) Orders page, which has a table of all their invoices. Generally, the self-hosted checkout flow uses a PaymentElement etc, but if something unexpected happens during checkout or if there's expired payment methods (off session), I was hoping to just direct customers to hosted_invoice_url. This way I don't have to bother with a page for customers to update their payment methods etc.
Oh, I looks like I suspected wrong here. I do see a new PM for my Customer after using the HIP to recover from an initially failed renewal payment. So that might be exactly what you're looking for.
Thanks for checking that, I really need to learn how to use the time clocks and sandboxes better.
Did the PM get set as the Subscription's (or Customer's) default PM?
or set it up for future usage
hmm. bummer. But thanks for the help π
Any time!
have a great day! π