#trueinviso
1 messages · Page 1 of 1 (latest)
What state are you referring to? Do you have an example?
What are you trying to do exactly?
well in the screenshot you can see that there is no ID yet for the item, so I can see the item in the Stripe dashboard, but the actual update isn't complete yet.
So my webapp is still waiting for the stripe update webhook to fire
Sometimes it takes a few minutes for that webhook to fire
So I'd like to display a message on the account page informing the user that their requested subscription update is in progress
Otherwise the user won't know that their subscription update was successful
Can you share the subscription ID here?
sub_1MC6RVHDRwNsRKsO4IamLN3A
This is the ID, but now the update is fully complete
there is a 2-3 minute window where the app is waiting for the customer.subscription.updated webhook to fire, which is plenty of time for a user to get confused and think the update failed.
hey sorry about the delay, missed the update her, looking
this appears to have had many schedules created and released on it
What updates are you making where you see this?
yes it has for testing purposes
any update I make, does not actually complete for a couple minutes
Are you using pending_if_incomplete? I don't see a request using that, but I'm trying to understand these updates you're describing
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
any update
Are you always making your change via schedule?
changing a plan is what I'm doing
yes, because of the business rules in our app, if they upgrade it needs to happen immediately, downgrades happen end of billing cycle. Each subscription can have multiple item changes
so sometimes there might be an immediate upgrade then a scheduled downgrade on another product in a few weeks
OK then if that's how you're using subscriptions to stage these subscription changes, you can inspect the subscription schedule attribute to see the attached schedule indicating some kind of pending change, which would allow you to show some kind of ⏲️ icon
https://stripe.com/docs/api/subscriptions/object?lang=ruby#subscription_object-schedule
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
If you need more detail you can retrieve that schedule or expand it on the subscription retrieval
https://stripe.com/docs/expand
expand[]=schedule
but how do I know if it's pending? Sometimes the start_date is already past on a phase, but the update hasn't actually completed yet
is there a specific field on subscription you are referring to?
What do you mean the update hasnt completed?
I think the presence of a schedule at all is what you're primarily looking for
then you'd evaluate whether there are any future phases beyond the current_phase
https://stripe.com/docs/api/subscription_schedules/object?lang=ruby#subscription_schedule_object-current_phase
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
there is no way to know if a phase on the schedule is complete
If there are no future phases and the schedule is set to release then there are no pending changes
What do you mean "complete"?
the actual subscription change hasn't happened yet and fired the customer.subscription.updated webhook
i would expect to find future phases if that were the case
also when I create the schedule it doesn't actually finish the last phase, it gives it an end date of the end of the billing cycle, even tho it's basically done already
That's within your control, you can release after the change
but its also why i say to look for future phases, ie, is there more than one phase (the current phase)
what do you consider a future phase, one that has a start_date in the future?
if there is only the current phase, unless the schedule is set to cancel when complete there will be no further changes
I can work around that, but my original problem remains, the last phase has started, but the actual subscription is complete with updating
is not complete updating I mean
usually it's like the screenshot I showed you, I can see the subscription item in the dashboard, but the item has no id yet
"items": {
"object": "list",
"data": [
{
"id": "si_MvyaHTL9063CVu",
"object": "subscription_item",
"billing_thresholds": null,
"created": 1670354218,
"metadata": {},
"price": {
"id": "sh_pro_135",
"object": "price",
"active": true,
"billing_scheme": "per_unit",
I wonder if that active field on the subscription item's price is false when there is no ID
So I just added another addon called multi-city, and I see it in the dashboard without an SI ID, when I retrieve the subscription, that item is not in the items list of the subscription, it only has the "active" ones
so I can't find a way to see the pending subscription items on the subscription that aren't added yet
I dunno, I guess I'm not explaining this well
When the phase changes (current_phase is updated, reflected in subscription_schedule.updated) the subscription update should happen at the same time
Are you seeing anything unexpected in teh data anywhere, or is this something you're seeing exclusively in the dashboard view?
If you set up your schedule to change the subscription much later, say tomorrow, do you see that item listed?
Or only once the phase changes?
so the update happens
What update
you're getting the subscription update event?
it takes a few minutes for the actual update to finish at that point
it takes a few minutes for the subscription update event to happen
so yes, I do get it, but it takes a few minutes
so for a few minutes the user is in a state where they don't know that their update was successful
this is the case without schedules as well
if I update the subscription using the subscription update endpoint, it can take a minute or two for the event to fire
Does my question make sense now?
OK, i think I understand now -- thanks for your patience
This appears to be related to processing the subscription changes due to phase progression
@valid falcon is going to help you out and i've shared some details around the complexity of managing phase changes here, since we are not currently emitting an event for the phase change
evt_1MC9BRHDRwNsRKsOaqxuhEmf is the change due to your update request to create an additional phase
really you need to be waiting for customer.subscription.updated to know when the subscription has been modified
Are you seeing the item with no id anywhere in the API data?
Or only inspecting in the dashboard?
When I retrieve the subscription in this state, it's not in the list of subscription items, even tho you can see it in the dashboard without an ID
When I retrieve using the API I mean, it doesn't contain the new item in the list of items even tho it's in the dashboard without an ID
Hi @alpine rapids 👋
@restive bronze had to step away. Are you able to write in to support and generate an email thread so we can get back to you async? This is a particularly complex issue and we're going to need to do some repro work on our end to fully understand what to advise and what needs to be surfaced to the product team.
You can generate that email thread here: https://support.stripe.com/contact/email
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
I guess there isn't a way to know, and I need to add the products on my side immediately, but mark them as pending. Then when the update event finally fires I can mark them as active
Tbh this seems like it would be a fairly common issue, but maybe a lot of people activate subscriptions on their end without waiting for the webhook to fire