#stibbs_best-practices
1 messages ยท Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- stibbs_webhooks, 3 days ago, 5 messages
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can 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/1247399002845216843
๐ Have more to share? Add details, code, screenshots, videos, etc. below.
Hi there, is you question about how to update the price of a subscription https://docs.stripe.com/billing/subscriptions/upgrade-downgrade#changing
Yes, but specifically via the Billing customer portal. https://stripe.com/blog/billing-customer-portal
OK. Can you share with me the billing portal configuration that you use to create the billing portal session?
The only change to standard was enabling customers to update subscriptions.
Here's an example session triggered from my app.
Above demonstrates that selecting the Yearly version of Full is not available, as it is already 'Selected'?
Code-wise I've been really impressed with how little it takes to get going with the portal ๐
const portalSession = await stripe.billingPortal.sessions.create({
customer: customer.id,
return_url: `${PUBLIC_BASE_URL}/account`
});
if (!portalSession.url) {
throw error(500, "Error retrieving billing information. We're working on it!");
}
throw redirect(302, portalSession.url);
Or can you share with me the portal session ID? or that I can look for its session configuration object.
test_YWNjdF8xSWdKQklGU1l6QUVFMm1ULF9RRUhIUEZrSm8wUTg3U1h2Rk1oQ0ExaWhIZGpPYkt40100gKwaUGvH
A billing portal session ID should start with bps_
{
id: 'bps_1PNokdFSYzAEE2mTkAv4Hinm',
object: 'billing_portal.session',
configuration: 'bpc_1PLajXFSYzAEE2mTDChhsyWf',
created: 1717474415,
customer: 'cus_QEDMjKkpoe9wO7',
flow: null,
livemode: false,
locale: null,
on_behalf_of: null,
return_url: 'http://localhost:5173/account',
url: 'https://billing.stripe.com/p/session/test_YWNjdF8xSWdKQklGU1l6QUVFMm1ULF9RRUhKUUxyaHZyU0h1RTAwV0RPN1plVGgxYThYSUhH01002zy3mllt'
}
I set up the product + prices as per these instructions: https://docs.stripe.com/products-prices/pricing-models#model-good-better-best-on-stripe
OK, this is the configuration object bpc_1PLajXFSYzAEE2mTDChhsyWf and it contains subscription_update[products][prices]. Is price_1PNnrIFSYzAEE2mTD2AvFTOt the price that you want your customer to be able to update to?
Correct, I thought the user would be able to opt into paying annually (price_id of price_1PNnrIFSYzAEE2mTD2AvFTOt) and get the discounted rate
OK, isn't it this one?
Is this about to be user error? ๐
Hmm, I don't quite understand what error you refer to.
Hahaha it is just me being daft... it does appear to work. Wow
Your customer can click on the 'Continue' button to update to the yearly plan.
The fact it was already 'Selected' made me think that the billing portal wasn't letting them pick it to change to, but they can still press continue and change to it. Just me misreading it (hence user error)
I see, so the UI/UX made you think that you are not able to change the plan, but in fact you can?
Yes. The highlighted 'Full' section and the text saying 'Selected' made me think it was behaving weirdly
I assumed the current plan would be the highlighted/selected one
Whereas it highlights/selects any price that corresponds to the product the user is subscribed
Ok. Thanks for the feedback, I'd pass along to the relevant team.