#samip_unexpected

1 messages ยท Page 1 of 1 (latest)

pulsar sleetBOT
#

๐Ÿ‘‹ 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/1393012791320907806

๐Ÿ“ 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.

worldly sandal
#

Could you share what you're trying to preview here?

river field
#

I am trying to migrate the Stripe SDK from a very old version 16.12.0 to the latest.

I found that there were breaking changes and invoices.retrieveUpcoming has been replaced with invoices.createPreview. All I am trying to do is view an upcoming invoice for a customer inorder to extract some data out of it.

worldly sandal
#

Thanks for sharing! Preview Invoice API only supports previewing the upcoming invoice for a subscription or subscription schedule, but not on customer itself. I'm afraid you'd need to explicitly pass one of those parameters to preview the invoice.

river field
#

Thanks, I'll try this out once.

worldly sandal
#

No problem! Happy to help ๐Ÿ˜„

pulsar sleetBOT
river field
#

Sorry, can I please get help on one more thing?

#

req_wNFLW5imB6qlEE

#

Previously, you could undo cancellation on a subscription by setting cancel_at_period_end to false.
It seems like now with cancelled subscriptions you cannot do that.

#

What's the next best alternative ?

#

What I am trying to achieve is this flow:

A customer signs up for a yearly subscription and decided to cancel at some point of time.
The customer has a change of mind and they want to resubscribe within the cancellation period (i.e before the actual cancellation happens)
We want to undo the cancellation they initiated.

jovial umbra
#

๐Ÿ‘‹ taking over from my colleague, let me catch up

river field
#

Sure

jovial umbra
#

@river field this requests (req_wNFLW5imB6qlEE) is making an update to a subscription that was already cancelled

#

Cancelled is a terminal state, so you can't update the subscription after that

#

I can see that sub_1RjC9UR9vNwGzNRDj5GyNEZu was cancelled on 10/07/2025, 05:35:32 BST when this event generated: evt_1RjCCnR9vNwGzNRDM8NuIzM8

river field
#

I have sent a sample flow above that I'd like to achieve, is it no longer possible ?

For your convinience, I am just quoting from the above

What I am trying to achieve is this flow:

A customer signs up for a yearly subscription and decided to cancel at some point of time.
The customer has a change of mind and they want to resubscribe within the cancellation period (i.e before the actual cancellation happens)
We want to undo the cancellation they initiated.

jovial umbra
#

*A customer signs up for a yearly subscription and decided to cancel at some point of time.
The customer has a change of mind and they want to resubscribe within the cancellation period (i.e before the actual cancellation happens) *

This is only possible if the customer schedules the cancellation, meaning that they cancel on a future date

river field
#

The cancellation is due to happen on a future date though ?

jovial umbra
#

In the example provided (sub_1RjC9UR9vNwGzNRDj5GyNEZu), the subscription is already cancelled when req_wNFLW5imB6qlEE is made

river field
#

Ah, makes sense.

jovial umbra
#

So let's say if your customer's subscription runs from 1 - 31 July.

On 12 July, they decided to cancel their subscription at the end of billing period, meaning the subscription will be cancelled on 31 July.

On 14 July, the customer changed their mind and decides not to cancel the subscription.

In this above scenario, you can use https://docs.stripe.com/api/subscriptions/update#update_subscription-cancel_at_period_end because as of 14 July, the subscription isn't cancelled yet.

#

Using the same example. if the customer wants the subscription cancelled immediately on 12 July, this is not reversible. The subscription will enter the terminal state (Cancelled) on 12 July

river field
#

Ah, thank you \

#

makes perfect sense

#

Thank you Aure and River (assuming they're going to read it), you've been great !