#mattwoberts-hosted-invoice
1 messages ยท Page 1 of 1 (latest)
Hi ๐ I think you're looking for the hosted_invoice_url:
https://stripe.com/docs/api/invoices/object#invoice_object-hosted_invoice_url
NO sorry, this is link I want to share with users, when they've started a subscription with a free trial and no payment (https://stripe.com/docs/payments/checkout/free-trials) - to encourage them to enter payment details
I know stripe have a stripe-hosted page, and that is sent to users via email when they are about to end their trial without payement...
I don't think we include a link in the emails about expiring trials, but the hosted page that sounds like a good fit is the Customer Portal:
https://stripe.com/docs/billing/subscriptions/integrating-customer-portal
According to the docs, you do include a link, to the stripe hosted page, in the email that's sent out... you can read about it here: https://stripe.com/docs/payments/checkout/free-trials#collect-payment
We know about the customer portal, and it's an option, but we'd really like to get to the "stripe hosted page" too, so we can point users to it for their first payment method
does that make sense?
Sorry, but I'm not sure what hosted page you're referring to.
Ok I'll try to explain what we're after...
So for our subscriptions, we crete them in code when a customer signs up. So the subscription is started with a free trial, and no payment method collected.
So - from reading your docs (https://stripe.com/docs/payments/checkout/free-trials#collect-payment) - when the trail is about to expire, stripe will email customers with a link to stripe hosted page, which will collect payment details for that customer.
The docs say: "Next, select the Link to a Stripe-hosted page option so the reminder email contains a link for the customer to add or update their payment details."
What we'd like to do is to also put that link on our app, to encourage the users to enter their payment details.
So that's the link I"m after, to that "stripe hosted page"
That Stripe hosted page would be the invoice's hosted URL in this case https://stripe.com/docs/billing/revenue-recovery/customer-emails#link-to-a-stripe-hosted-page
How can it be a invoice url if the invoice hasn't yet been created?
This is a reminder email that's sent out a few days before the invoice is created
Ah I now see that that section is actually about failed payments. Looking again
I'd say it's more about subscriptions that expire when no payment details have been entered... anyway thanks for this, it's causing us some confusion!
Oh the next section we have actually touches on this scenario. Sending them to the Customer Portal is how they can enter their payment details before the trial is over https://stripe.com/docs/payments/checkout/free-trials#customer-portal
Hmm. So are you saying that there isn't a page where we can send users that just collects payment details? I did know we can use the customer portal, but for us, we wanted a clear and focused page we could prompt these users to, to JUST allow them to enter card details. Once that was done, we'd open up the customer portal to them...
And it's just that the previous bit in those docs says it will send a reminder email when the trial is about to expire, and that the email will contain a link to update their payment details.. .I was hoping that was something I could use also...
You can define a customer portal configuration such that the only thing the user can do on it is add their payment details. That is probably what our automated email sends. Otherwise you can send the user to a Checkout page in Setup mode which would also be a hosted page dedicated to collecting their payment details
Other than those I don't think we have further pages for adding a payment method like that
Hmm - that checkout page sounds good - would it work OK if the customer and subscription are already there? I presume so...
It wouldn't really take them in to account so yes it should work.
Yeah - it's probably just making a setup intent and acctaching to the customer, so ๐ค
Actually, in that vane, the Checkout Session would set up a card for future use but it wouldn't automatically set it as the default payment method on the Customer or Subscription
Exactly
Hm - would I need to do that via a webhook?
Exactly. checkout.session.completed would probably be the most direct but any of the other setup intent events or payment_method.attached would work here
Gotcha. Glad we got that sorted in the end. Thanks for your help there, and I hope you have a good weekend!
Of course, have a great weekend yourself!