#yamith_customer-portal-subscription-updates
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/1332045487184023562
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- yamith_api, 15 hours ago, 6 messages
Hello! It's likely you haven't set up a product catalog to define what's eligible to be upgraded or downgraded. See here for details: https://docs.stripe.com/customer-management/integrate-customer-portal#set-product-catalog
I have four products but I don't see the option to choose which is suitable for downgrade or upgrade
Can you give me the IDs of the four Products so I can take a look? It's the IDs starting with prod_
prod_RTcpAHMUS5DiUh
prod_QZ3VF4fNpKmPXV
prod_QXVP1Ri5uLAVsA
prod_QWrgaNwVCGvAdj
version test
It looks like you've set it up here so people can switch between plans: https://dashboard.stripe.com/test/settings/billing/portal (expand the Subscriptions section there). That's not working for you?
Sorry, I can't read that. What's below that part of the screenshot, though?
There should be list of options for people to switch between.
Do you want you to put a ss of the entire screen?
Just the Subscriptions section you expanded.
Yeah, so you have several options listed there for people to switch between. You're saying they can't switch between the options you've specified there?
Moment please
It already lets me select the plan but if I select a lower one, it makes the change after a month and not when the billing period ends
It is as if it does not take into account the configuration that I am sending to it by the API
That's because you're setting this:
features[subscription_update[schedule_at_period_end] value true
But if I put a higher sub if you make the change when the billing period ends
The sub that is active in this case is three months, it should last until April
In other words, what I want to do is that when it is a downgrade, it is done at the end of the active subscription, the upgrade is done immediately
Sorry if I don't know how to explain, you can ask whatever you want.
I think you want to set some conditions here: https://docs.stripe.com/api/customer_portal/configurations/create#create_portal_configuration-features-subscription_update-schedule_at_period_end-conditions
Give that a try and let me know if that works to do what you want.
Okay please don't close the conversation
We close idle threads after a bit, but you can always use the buttons in #help to ask another question if you need more help and this thread is closed when you come back.
Use decreasing_item_amount condition but still the same
features[subscription_update][schedule_at_period_end][conditions][decreasing_item_amount] value true
Those are the only options, I'm afraid. If those conditions don't give you the behavior you want you'll either need to live with it the way it is or not use the Customer Portal and handle upgrades and downgrades yourself.
I don't understand, because it works the other way around, when upgrading it is done at the end of the active sub and the downgrade is done after a month
It sounds like you want an "increasing item amount" option for a condition, but that doesn't exist currently.
yamith_customer-portal-subscription-updates
I just want that when downgrading a sub it is done at the end of the current sub's period, when upgrading the sub it is done immediately, as it says on the portal ๐ฆ
Can you share the request ID for the request where you created the configuration with decreasing_item_amount set to true?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
req_4aN9baUnSJOFiT
You didn't set decreasing_item_amount in that request.
In fact, you didn't set anything regarding schedule_at_period_end in that request.
Have a look at the request in your Dashboard to see the parameters we received: https://dashboard.stripe.com/test/logs/req_4aN9baUnSJOFiT
If that was what I was seeing, it is empty, nor is the condition
Not sure I understand? To clarify, in that request, you are not setting features.subscription_update.schedule_at_period_end.conditions.type at all: https://docs.stripe.com/api/customer_portal/configurations/create#create_portal_configuration-features-subscription_update-schedule_at_period_end-conditions-type
i'm sending it like this, should I put something else? features[subscription_update][schedule_at_period_end][conditions][decreasing_item_amount] value true
Hi there ๐ jumping in as my teammate needs to step away. One thing I do want to point out, is that Bubble.io is a third-party platform offering Stripe integration functionality. We can't guarantee that what they offer aligns with the current state of our API. I wanted to call this out in case that's what is happening here, that Bubble.io hasn't add the necessary parameters for you to use this.
I'm taking a look at the request you shared and catching up on that.
Ok toby
Yes. If you want the Subscription's update to happen at the end of the billing period, and the only change being made to the Subscription is that the quantity is being decreased, then you'll want to set that parameter to true when creating the Billing Portal Configuration and use that Configuration when creating a Portal Session.
This is how I am passing the parameter
features[subscription_update][schedule_at_period_end] value true
But it does it for high subscriptions and not for low ones, I need to invest it
Can you show me where you're setting it that way? That wasn't in the request you shared earlier. Looking at our API ref, I don't believe that's the correct way to set that value either.
https://docs.stripe.com/api/customer_portal/configurations/create#create_portal_configuration-features-subscription_update-schedule_at_period_end-conditions-type
Looks like it's down in features.subscription_update.schedule_at_period_end.conditions.type
Can you share the request ID?
The last feature is that features[subscription_update][schedule_at_period_end][conditions][type][decreasing_item_amount] value true
I don't know the Bubble side of this, so I'll always need the ID of the request you made to see what we received on our end.
req_czu4vVR1EsPMZj
Does not take it, sends the empty parameter of the condition type
It's like it didn't send the condition
Agreed. There are multiple parameters in that screenshot that aren't making it to us based on the request ID you shared.
Unfortunately, I don't know Bubble's flows well enough to speculate on why that is, but I would recommend first focusing on figuring out why not all the parameters are coming through. Then once that is solved shift your focus to figuring out the exact syntax for the parameters.
Like I don't see the tax_id value in the request you shared either.
No, none of us know the Bubble side of things. If there are questions on that, I'd suggest reaching out to Bubble's support team.
I'm happy to help further if you can get all of the parameters coming through to us, but I don't know enough about the pieces outside of our system that you're using to help troubleshoot those.
I will do what you suggest, when I send all the parameters correctly I will let you know
I'm sending it now like this
features[customer_update[allowed_updates][]=email&
features[customer_update[allowed_updates][]=tax_id&
features[customer_update[enabled]=tru&
features[invoice_history][enabled]=true&
features[subscription_update[enabled]=true&
features[subscription_update][schedule_at_period_end]=true&
features[subscription_update][schedule_at_period_end][conditions][decreasing_item_amount]=true
And so it sends me the tax id, but subscription_update gives me an error
Ah ha! Okay, closer then, let me double check the structure of that parameter.
(If you have the request ID from when that error was thrown can you share it? So I can see exactly how things came through to us)
Looks like the parameter name should be: features.subscription_update.schedule_at_period_end.conditions.type
and that is expecting a string (actually an enum), so in this case you'd use the value:
decreasing_item_amount
I don't understand, the value should be a number or the decreasing_item_amount parameter
No it shouldn't. decreasing_item_amount is a possible enum value that you provide to the ...conditions.type parameter, indicating to us what type of conditions should trigger the subscription update happening at the end of the billing period rather than immediately.
shortening_interval is the other supported type of condition for this behavior.
Umm ok let me try
I'm trying to send request with postman and look
Do you have the request ID, so I can see what is coming through to us?
That request has no body
https://dashboard.stripe.com/test/logs/req_pTKdpdvzTmNyLn
It was also made with Bubble (based on the user agent) rather than Postman
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
The requests I make through postman should appear there too, right?
This one has features.schedule_at_period_end: "true", which isn't a valid parameter as the error indicates.
https://dashboard.stripe.com/test/logs/req_3y1FviLe9eZvuc
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Yes, the requests you make with Postman will still show up in your logs, as long as you're using the API key that belongs to your account when you make them.
req_Re7mpRTxQJMRnY
I don't understand. The parameters in your Postman screenshot aren't aligning with the parameters in the requests you're sharing. Are you sure you're sharing the correct request IDs?
Also, the Postman screenshot is including a features.subscription_update.schedule_at_period_end parameter, which isn't a valid parameter. Did you uncheck or delete that one, and only use the one below it?
Oh, and sorry, I should have explicitly pointed out sooner that our APi ref shows that features.subscription_update.schedule_at_period_end.conditions is expecting an array of objects.
You unchecked the opposite of the one I suggested.
Well you're still passing true as the value there. so I expect errors to persist. And you aren't passing an array to ...conditions, so it seems expected that you hit an error there too.
You'll need to include a reference to the specific array location in the parameter name. Like:
features[subscription_update][schedule_at_period_end][conditions][0][type] with a value of decreasing_item_amount.
req_UG0Dvnvc3nI4kk
Something like that with this?
What would be a valid value for decreasing_item_amount?
No, the value is not a number, the value will be decreasing_item_amount. The key will be what I shared in the previous message.
Seems like you resolved the errors with that parameter. Now, as the error indicates, you need to add the features[subscription_update][products] parameter.
That parameter is expecting an array of objects, where the contents of that object are either a prices key with an array of strings of the Price IDs, or the product key with a string containing the Product ID.
https://docs.stripe.com/api/customer_portal/configurations/create#create_portal_configuration-features-subscription_update-products
You need to put the number of the array position, the way you did for the parameter we were working on previously, along with the key for the specific field in the array you're providing.
features[subscription_update][products][0][product]
You'll need to increment the number when you use it the second time in the same request.
The error explains what is missing
Price but adding the price gives an error
What is that error?
You got a successful response, and the values you set are being reflected within the response body. So it seems like it's time to test the behavior of this configuration and see if it does what you're hoping.
Okay, I'm going to try it in bubble and I'll tell you.
This request is from bubble.io and does not send all the complete information
req_Kzjl8Lo3hRxFjF
As mentioned before, that isn't something we're able to assist with. I'd recommend reaching out to Bubble's support team to troubleshoot why their platform isn't sending all the parameters you're setting within it.
thanks! toby!
Question
Hi! Go ahead. ๐
I already have an active subscription, and I am going to change it to a more expensive and longer one, it tells me that it will be effective until the current one ends, and I do not have it configured like that, it should be changed at once
Is that your question? Are you still trying to do this via the Customer Portal, or is the Subscription change being done via Stripe's API?
Portal customer
Can you share a Request ID for your latest attempt?
What happens, when I activate the portal with the configuration ID, it doesn't let me update, but, if not that implementation is "Activated", it does let me update, but with those conditions
req_INPhXMhRf3LqrR
And this is from the latest configuration req_wdnG6fCminnjAA
Because you didn't specify your custom Customer Portal Configuration when creating the Portal Session it's using the default Customer Portal Configuration.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Exactly what should you specify when creating the portal?
Ok, I added features[subscription_update][enabled] to the portal and it allows me to edit it, but it still appears the same, the upgrade until the end of the current period, and the downgrade "immediately"
Yes, but you're not using that Customer Portal Configuration so those changes won't apply.
Why?
I don't know - why aren't you including your Customer Portal Configuration ID when you create the Customer Portal Session?
Cool. Can you show me a Request ID for a Portal Session where that configuration was used?
req_G3JQA3sLZar537
https://dashboard.stripe.com/test/logs/req_G3JQA3sLZar537 Do you see the parameters that got sent to Stripe on that one?
In fact, not only did I notice that the configuration ID was there, but the parameters were not there.
The Configuration ID that you are providing is not in the Request parameters; a different Configuration ID is present in the Session object.
let me see
Cool. Also your Body type could be changed to form-data.
If I pass it to form-data this happens
Well, that's a new error at least - we're moving forward!
Can you please share that Request ID?
If I create the portal with that parameter in postman it gives me this error
features[subscription_update][enabled]this
req_jPS5KSjamrgsnm&filtered=true
Did you look at that Request in the Dashboard?
With that parameter I was trying to create the client portal, according to the documentation you gave me
But the goal is to get this working in Bubble, right?
Yeap!
But, well, trying to understand what is not useful, because in bubble sometimes it does not show the error like in postman
I think that's because it's failing spectacularly.
This is ~what you want to be using: set the Content-Type to application/x-www-form-urlencoded and put the parameters in the raw body box, with each parameter separate by an &.
Let me try
I have already set the creation of the portal and the portal configured
Hi ๐
I'm taking over as my colleagues have to go. I understand you are having trouble creating the customer portal with the features you want. Is that correct? Could you give me a summary of what the issue is?
Hi Snufkin,
Yes, I am creating the client portal, but the problem is that I need that when a downgrade is made it takes effect when the period that is active ends, and when it is upgraded it takes effect immediately. and this right now is backwards
Okay and have you identified what parameters in the Customer Portal configuration would allow for this?
These are supposed to be features[customer_update][allowed_updates][]=email&
features[customer_update][allowed_updates][]=tax_id&
features[customer_update][enabled]=true&
features[invoice_history][enabled]=true&
features[subscription_update][enabled]=true&
features[subscription_update][schedule_at_period_end][conditions][0][type]=decreasing_item_amount&
features[subscription_update][products][0][product]=prod_RTcpAHMUS5DiUh&
features[subscription_update][products][0][prices][]=price_1QafaH09LC4lNyTLVzHHOAvL&
features[subscription_update][default_allowed_updates][0]=price&
features[subscription_update][enabled]=true&
features[payment_method_update][enabled]=true
But right now I create the portal and it won't let me do anything
Can you share the request ID for the API request to set the configuration?
Sessions req_hUyrEU74DSwp4S
Configuration req_2IVgA1WBCE2zp9
Thanks, taking a look
๐
Okay so you are using the schedule_at_period_end.conditions.type to specify that any change which decreases the subscription item amount will result in a change that occurs at the end of the billing period.
The definition of decreasing_item_amount: https://docs.stripe.com/api/customer_portal/configurations/object#portal_configuration_object-features-subscription_update-schedule_at_period_end-conditions-type
Yes sir!
And you are not seeing that behavior? I notice you are only allowing a change to 1 price
Which makes sense, since your subscription only has 1 item
Have you tested making these changes through the portal?
No, I'm going to put the other prices and you'll see that the update button doesn't even appear
OH you mean you can't update the Subscription?
Okay that might be an entirely different kind of error
Do you have the ability to Cancel the subscription?
Okay it seems like you are running into a limitation of the customer portal. There are quite a few and honestly we don't do a good job of surfacing them in the UI (we don't surface them at all). You can read about them here: https://docs.stripe.com/customer-management#customer-portal-limitations
I'm still looking at your Customer and Subscription to try and understand what the exact problem is
Ok, Ok, I already added the other product, and it does let me update, but not until the date of the one that is already active ends, which is in 3 months
Okay I think there is an issue with the unspecified tax behavior of the original Price that might be causing an issue
Customers can only modify subscriptions if the new price has the same tax behavior as the initial price. Additionally, no modifications are allowed if the tax behavior is unspecified, even if the tax behavior of the new price is unspecified.
I already added all the products, but the same behavior continues. Upgrade is carried out at the end of the current version and downgrade is carried out immediately
Is there an internal setting in Stripe that is reversing this setting for us?
Is there an internal setting in Stripe that is reversing this setting for us?
No there is not.
Are you actually completing these updates? Can you share a Subscription ID where these updates are taking place
It doesn't give me a record, it was only changed in stripe, but I assume the will be updated on the date it said
req_JpFjaLODYDioIO
Unfortunately I can only provide support in English
Sorry
That request ID is for an update to a test clock. Not the subscription itself
When I changed my subscription it did not give me a registration
I'm going to create a new one and change subs
Just the subscription ID will be sufficient. I can see the changed made to it
req_OrZ7BvOpf4slGI
Ok something changed, I can now make the change at the end of the current period, but I can also upgrade them
I think this is related to the restrictions I shared with you earlier.
I recommend you review them carefully so you understand what Subscription parameters will prevent your customers from being to use the Customer Portal to make changes.
If that is going to occur often with your integration, I recommend you build your own Subscription update UI.
I already have it, except that when doing it with the schedule it gave me a lot of errors, so they told me to implement the customer portal which was "easier"
"Easier" - only if your subscription & customer set up is configured in a very specific way
I'm realizing this, because when I buy the 3 month sub the problem comes back, but I don't know how to configure that in stripe
Can you try setting a tax_behavior on the 3 month Price to either 'exclusive' or ''inclusive'?
https://docs.stripe.com/api/prices/update#update_price-tax_behavior
From the API or in the Stripe interface
Is there any call that will bring us all the information related to the products I have?
Sorry what kind of information are you looking for?
All the configuration that each of the products could have
I don't know what you mean by "all the configuration"
You can retreive all your Products from the Products API https://docs.stripe.com/api/products/list
Ok ok thanks
Sure thing! Happy to shed what ๐ก I can ๐
Have quest
Question
This was how I was trying to request the issue of downgrades at the end of the period before messing with the customer portal
Here I make the schedule, but two phases are created plus the one that is active, when it is assumed that 0 is the current one and 1 would be the phase to which it should go when the time of the current subscription ends
Can you send the ID of the schedule that was created?
Okay, you passed 2 phases and the Subscription Schedule that was created has 2 phases
You can see the request and response here: https://dashboard.stripe.com/test/logs/req_4PiHqPlNkoaVHY
The start date is pretty far in the future though
Yes, that's what I mean by creating two phases.
The current one should end on April 23, 2025 and the monthly sub will begin that same day, when the current one ends
What "current one". This schedule has no relationship to any "current" billing period
How could I make the proper request to be able to fix this?
What do you want do?
I have to step away but my colleage @green willow will be available to answer further questions.
๐
What I want to do is that if I have an active subscription and I want to do a downgrade it is done when the active one runs out, but if I want to do an upgrade it is done immediately
๐ gimme a while to catch up!
No prob!
What I want to do is that if I have an active subscription and I want to do a downgrade it is done when the active one runs out, but if I want to do an upgrade it is done immediately
I'm going to put aside the previous request that you made for now.
Assuming you have an existing subscription, the immediate upgrade should be fairly straightforward since you don't need a subscription schedule for that.
If you do an downgrade, you create a subscription schedule from an existing schedule, then you update the subscription schedule.
Which of the above have you tried and are having issues with?
At this moment, the one that had already been sent to you creates two subscriptions, now only send one, the one you create remains on the dashboard, but when you advance the clock it does not become effective and the one that is already there continues, or both remain active
Hi @ripe niche I'm taking over this thread.
Let me know if you have any follow-up questions
Hi Jack!
Everyone, I really haven't resolved anything since 2pm today that I've been in contact with you, and I appreciate that.
In conclusion, I am looking for a solution for my problem, and that is to be able to downgrade an active subscription at the end of it, and the upgrade to be done immediately,
I tried through the client portal, making a schedule for the subscription and nothing was achieved ๐ฆ
Ok, so you want to use billing portal to schedule a downgrade at the end of the period? Did you set https://docs.stripe.com/api/customer_portal/configurations/create?lang=node#create_portal_configuration-features-subscription_update-schedule_at_period_end-conditions-type ?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Yes and it doesn't work
What's the portal configuration ID?
It works for certain Prices, and also for all grades, you are on a three-month subscription and you upgrade when the current one ends, it is working the other way around
Can you share with me the ID so that I can check?
bpc_1QkaJD09LC4lNyTLFh6TxALZ
And does the price that you downgrade to belongs to the same product that associated with the existing price?
No
Here the price id and product id are well defined.
I see, I think that's why it's not working.
https://github.com/stripe/stripe-node/issues/2251
The price you wish for your customer to update must be associated with the same product to which the customer is currently subscribed.
The same issue was discribed here, and you can find details in this ticket.
Ok thanks
Do you know how I can do the thing of having two prices on the same product?
Would I have to put the four prices that I have on the same product for it to work on all of them?
You just need to specify the same product when creating a price https://docs.stripe.com/api/prices/create?lang=node#create_price-product
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.