#paul_best-practices
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/1461102964528644166
π Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there π I'm not sure if it got cut off in the form submission, but can you elaborate on the guidance you're looking for?
Just a bit of architecture guidance to see if we started off doing things wrong and need to rethink what we are trying to do. It seems like the stripe customer portal is limited when the customer needs to manage multiple subscriptions or subscriptions with multiple line items. Everything I am reading, we should be handling all of that in our web app and Stripe API calls to do the work.
- Should we not let the customers manage subscriptions in Stripe customer portals? They seem limited i.e. cannot select a single subscription or line item to manage.
- Only redirect the customers to the Customer Portal to manage payment methods?
- The initial buy link where the recurring payment info is collected is there a way to set the payment method as default? (This initial buy works fine, after this we want to be able to add additional line items and manage subscriptions)
- Redirecting to Stripe dashboard/portal for customers to manage their own subscriptions seems problematic. Should we be doing all of this in our web app and managing the subscriptions and prorated invoicing through Stripe API calls?
Sorry, the form submission caps me at a certain number of characters and it is hard to get it all down. π
1 is more up to you. I can provide guidance on whatever route you choose there, but you know your business requirements best and are best suited to decide whether the Customer Portal can satisfy them. The Customer Portal isn't perfect, it does come with some limitations, but it's quick to set up. So there are trade-offs either way.
Same with 2.
For 3; just to make sure we're aligned, you're referring to Payment Links?
When I look a a customer and see the payment method, it does not show as "default". When I make calls to the API to create an invoice, finalize and pay it does not get paid because it says there is no default. I marked this one below as paid in the Stripe console and then it worked fine.
this is the one that has a default
Sorry for not being clear, I understand that part. I'm trying to better understand what exactly you're referring to by "buy link" to see where best to slot an optimization for this into your flow.
Ok, that would be a Payment Link: https://buy.stripe.com/test_28E5kF5A6bZ0g9bc3c2VG0g
Gotcha, I'm double checking whether there is a way to set them up to save that for you, or if that's something that will have to be caught and handled downstream.
I'm not seeing a way to set up a Payment Link to do that automatically. Are you familiar with webhook endpoints?
The short version is that you can listen for checkout.session.completed Events. From there you'll make an API request to update the associated Customer object, passing the ID of the Payment Method that was used to the invoice_settings.default_payment_method field:
https://docs.stripe.com/api/customers/update#update_customer-invoice_settings-default_payment_method
I've got to step away, but my teammate can help expand on any part of that which you aren't already familiar with.
Hi there - I'm taking over for toby
I can handle that easy enough in our python webhook! Thanks!
Now for #1 above let me get some screenshots to show what we are attempting (might be more descriptive...
Initially, we had only one subscription choice (Cannopy Gold/Silver, Monthly/yearly choices). We have a Customer Portal that works fine for that allowing them to manage that subscription. Changing between the 4 options. We want to add another line item to the subscription (Additional Store Monthly/Yearly with quantity) as shown in the screenshot I added this through postman API calls.
Next screenshot shows the portal...
The portal now only shows "Cancel Subscription" no longer update. Is there a workaround where the customer can still manage on Stripe or at this time we need to handle everything from our end?
What the Customer can/can't do in the dashboard is defined by your billing portal configuration, which can be modified in the dashboard or via the API
https://dashboard.stripe.com/settings/billing/portal
https://docs.stripe.com/api/customer_portal/configurations?lang=curl
What's the id of the Customer for the second screenshot?
cus_TRTZthWWGhvZkj
Here is the billing link for that portal:
billing.stripe.com/p/login/test_4gM14pe6C4wyg9b7MW2VG01
It looks fine when the customer has only one line item in the subscription
and here
Let me have a look at the portal config and see what I find
This one bpc_1SlHEvP3kMdJqAOwMhDyw0wI
I find one request where you're using bpc_1SpCe7P3kMdJqAOwOxRMAfmR as well
but I'm not yet sure how different the two are
That is the one I created for Additional Stores subscription.
I tried a customer with 2 subscriptions and when I went to either portal, both subscriptions showed. If I updated the one that was not intended, It really messed up the subscriptions.
... sorry, it is really hard to describe in chat.
Anyway, I decided it was easier to just add a line item to their existing sub. Having multiple subs is problematic in our backend anyway. But the 1 sub with 2 line items seems to have it's own problems.
is sub_1SUac9P3kMdJqAOwL93lUme2 the Subscription from the screenshot where you can only cancel? I want to check it against the list of Customer portal limitations
It is
I found:
Customer portal limitations
The customer portal has the following limitations:
If subscriptions use any of the following, customers can only cancel them in the portal. They canβt update these subscriptions.
Multiple products
That leads me to believe they would have to manage things on our side through the Stripe API calls
Yeah that's what I noticed as well
Multiple Subscriptions and Multiple products in a subscription having problems points to just doing it through API calls on our end. Is that the way many clients go?
Yeah, we've made a lot of progress in making the Customer Portal more robust in the couple of years since it launched, but hosted surfaces like this are usually not as powerful/configurable as the API. Users who have need a really fine degree of control or who need parity with the API will often use their own solution
(which involves just manipulating the Subscription via the API in response to customer input on their own surface)
That was the direction I was thinking I need to go. A lot more work on my end than just setting it up on your end, but I am thinking that might be the best/only way to go for our business needs.
I'm looking around right now to see if supporting multi-price subscription updates in the portal is on our roadmap
I have been manipulating the sub I am testing with. Postman/API calls. Not really difficult. Might be easy enough to change all that to just some Python classes.
Yeah, I have a react app that does this that I use for testing
I figure I just need to make calls: 1. Update sub with prorations. 2. Create Invoice. 3. Finalize Invoice 4. Pay Invoice. of course with the right payloads...
but it does look like supporting mutli-price subscription updates in the portal is on our radar, though we don't have a timeline. I've added to the request for that feature on your behalf, for what its worth
Thanks! I work for a startup, so of course they want all this yesterday to get money coming in. Might have to go with the API route to get it out.
Understood!
Well, I really appreciate your help today (thank Toby too)!
Seems like between your documentation and AI chat I can get this done.
Yeah Subscriptions can be tricky but we're here to help! If you come back with more questions we'll have a link to this thread
Ok, going forward I will try to keep my questions more targeted!