#Benoît
1 messages · Page 1 of 1 (latest)
We close threads after some time of inactivity so our list of threads doesn't get too long and unmaintainable
What's your question?
@plush harness Are you there? You said you needed the thread back open
Sorry !
My problem was that i needed to resume a paused subscription, but reseting in the same time its billing cycle anchor. So, your collegue suggested me this :
Thinking out loud, I think you could make somethign like this work:
- You have the subscritoin that was paused on august 10th
- When the customer resumes on december 25th you calculate when you want the next billing cycle date to be and set pause_collection.resumed_at (https://stripe.com/docs/api/subscriptions/update#update_subscription-pause_collection-resumes_at) to be that date (Jan 14th)
I believe when Jan 14th rolls around you should get a customer.subscription.updated webhook event and you can see if pause_collection was changed. If it was, you can reset the billing cycle anchor immediately
*
Ok yeah that makes sense. Did you have some follow up questions?
Yes, i have a problem with my IDE when i try to set the resumes_at property
Can i show you my method ?
Sure. What's the error you're getting?
I have to write this for my code to work :
(<Stripe.SubscriptionUpdateParams.PauseCollection>params.pause_collection).resumes_at = reactivateAtTimestamp;
Yes, if i cast the PauseCollection object, it works
How could i set pause_collection.resumed_at when the customer resume the Subscription, while i have to set pause_collection: '' to resume the Subscription ? https://stripe.com/docs/billing/subscriptions/pause#unpausing
Not sure I understand the question
https://stripe.com/docs/api/subscriptions/update#update_subscription-pause_collection-resumes_at sets it to a future time
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
To resume a subscription, i have to set pause_collection: ''
If i set it to pause_collection: '', how could i also set pause_collection.resumed_at in the same time ?
That's impossible
You see what i mean ?
You wouldn't do both. In the example you shared you'd just set pause_collection.resumed_at so that it resumes payment collection on that date
Property 'behavior' is missing in type '{ resumes_at: number; }' but required in type 'PauseCollection'
I can't only set resumes_at, behavior is needed
If think i will have to find another way to do what i want
How did you pause the sub?
you should have already passed behavior
You'd just pass the same thing again
pause_collection: { behavior: 'void', },
Yeah so just pass void again when setting resumes_at
Ah ? Ok i will try
You wouldn't want to change the current pause behavior. Idea is to only set the date you want to resume
I haven't finished my tests
@west cape unfortunately, the subscription.updated webhook has not been fired after the end of the resumes_at timestamp
Hello! I'm taking over and catching up...
Can you give me the Subscription ID where you tried this?
Hello ! Yes
That was this one : sub_1NYY0qAYYvne95SHKMaiYiDj
But i made another test since. would you like me to reproduce and warn you when the resumes_at has been done ?
Let me take a look at this one, hang on...
i saw you "idle" so i retried
Oh, I always show as idle on Discord. 😅
Here is my last events :
Subscription pause : evt_1NYxpLAYYvne95SH84Wx3jpV
Subscription resume : evt_1NYxuSAYYvne95SHrUA4yelZ
For the resume, i set a resumes_at after 2 minutes, so i was waiting a new subscription.updated webhook event to be triggered 2 minutes later, but there was no event fired, althought i see on the dashboard that the subscription pause has well been resumed
(qorry if i'm not clear :/)
Ah, okay, I don't think you're giving the system enough time to pick up the change. Can you try testing this with a test clock instead of waiting in realtime? https://stripe.com/docs/billing/testing/test-clocks
You think 2 minutes is to few ?
It's usually best to test with actual, real world durations in a test clock rather thank fake short durations in actual time when it comes to testing this kind of thing.
Yes.
Ok i made some tests, i see the update
Meaning it worked?
I doesn't worked like i would have expected
How so?
My need is : My customer subscribe to a plan on august 1st. He pause his subscription on august 10th (so he used only 10 days, and 20 days remains).
He resume his subscription on december 25th.
I wanted the billing cycle anchor to be reset to (december 25th + 20 unused days) = january 14th
In my test clock, i can see that an invoice has been paid on december 25th
To clarify, will you know in advance when they resume their Subscription?
I don't know when they will resume, but i will know how many days would normaly remains until his next invoice
So when he will resume, i will know the date i would like the billing cycle anchor to be reset
It sounds like your use case doesn't fit the scenarios pausing collection is designed for: https://stripe.com/docs/billing/subscriptions/pause
Have you considered canceling the Subscriptions and issuing a Customer credit instead? https://stripe.com/docs/invoicing/customer/balance
I don't want to cancel the subscription, because i need to limit the churn rate
Not sure I understand? How the Subscription is handled is an implementation detail, how would it impact churn?
Churn is impacted when the cancelation comes to its end, doesn't it ?
I guess it depends on what you define as churn. As I understand it your ultimate goal is to allow people to put their subscriptions on hold for an undefined period of time, and then resume them later, where the amount of time they were on hold shifts the subscription period into the future. Is that correct?
Yes but it must shift only the number of days between the resume date and the "normal" invoice date. In my example, althought the subscription is hold for several month, the shift must only be 20 days
If I were implementing something like that I would cancel the current Subscription and then create a new one when they "resumed", but I wouldn't expose the fact that there were multiple Subscriptions involved to the customer, it would just be an implementation detail.
You're talking of the churn rate ?
I'm not sure what you're defining as the churn rate, to be honest.
How do you calculate the churn rate?
In fact, we are preparing a fund raising, and we need to low our actual churn rate because it's to high (17%)
Until we are able to low it by "improving" our app, we must "artificialy" low it by some other ways.
When our customer cancel their subscriptions (after 1 to 3 months max), the churn rate is highly impacted.
I thought if we pause the subscription instead of cancel it, the churn rate would not be impacted because the customer is "artificialy" still a customer, you see ?
Hi, stepping in and catching up.
hi 🙂
Yeah, helping you lower your churn rate is not something we can advise, you'd want to test these first to make sure that it fits your business use case. We're happy to help with any integration related questions.
I know, that was not my default question
My need is : My customer subscribe to a plan on august 1st. He pause his subscription on august 10th (so he used only 10 days, and 20 days remains).
He resume his subscription on december 25th.
I want the billing cycle anchor to be reset to (december 25th + 20 unused days) = january 14th
Yeah, without creating a new subscription with the future billing cycle anchor https://stripe.com/docs/api/subscriptions/create#create_subscription-billing_cycle_anchor. It's not going to work how you describe on the existing subscription.