#blackbearftw_webhooks

1 messages ¡ Page 1 of 1 (latest)

merry vineBOT
#

👋 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/1326629911552852119

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

wary patio
#

Hey there

clever escarp
#

I am guessing if the user cancels a subscription, they will still be billed at the end of the period. Currently trying to handle the user deleting their account (automatically cancelling their subscription) and just a normal cancellation.

But my system only looks at the current status of the subscription, if its not "active", it will basically lockout the user. But I only want that to happen at the end of the billing period, since their subscription should still be valid for e.g. that month

wary patio
#

Oh

#

You are using cancel_at_period_end here

clever escarp
#

I don't know

wary patio
#

That said, same concept.

#

The Subscription will stay in status: active until the Subscription is actually canceled, at which point it moves to status: canceled and the customer.subscription.deleted Event fires.

clever escarp
#

oh okay

#

but I have the choice to either do that right away or do it at the and of the period

#

that is what you configure cancel_at_period_end

#

for

wary patio
#

Yep

clever escarp
#

mhm okay

#

please keep this open for a bit

wary patio
#

Sure

clever escarp
#

one last question, if you choose to cancel their subscription right away, will they also be billed right away?

#

or is that still at the end of the period

#

its a pay as you go subscription btw

wary patio
#

Are you using Customer Portal here? Or you are canceling yourself via the API?

clever escarp
#

customer portal

wary patio
#

If you set it to create_prorations then it will create a proration item to be charged on the next Invoice for that Customer.

clever escarp
#

okay

#

yeah I just heard they want the system be accessible till the end of the period, then after the period ends they want the customer to be billed one last time and then basically switch the status on our end to "cancelled" and then deal with everything related to that

wary patio
#

Hmm that is a bit more complicated.

#

In that case you would essentially need to charge them using a one-off Invoice after the Subscription cancels.

clever escarp
#

really

#

mhm

#

so won't my meter work if the customer has cancelled their subscription

wary patio
#

Ah you said "bill as you go" as in usage based

#

I missed that

clever escarp
#

yeah

#

basically, they cancel their subscription, which is fine, it waits till the period is over, then gives our webhook the cancelled event (doing stuff in our system) and after that it of course bills them

wary patio
#

Okay I think this should still bill them at the cancellation point

#

But really I haven't tested this in quite a while

#

So you would want to test

clever escarp
#

using the test clock right

wary patio
#

Yep

clever escarp
#

but customer.subscription.deleted gets executed at the end of the period?

wary patio
#

Yes

clever escarp
#

Alright and now I just need to find in stripe where I can set that behaviour

#

because I am guessing the default is to fire that event right away

wary patio
#

If you are just using the Dashboard's set behavior for your Portal Config

clever escarp
#

yeah

#

I see thanks

clever escarp
#

if I cancel it manually through the API, anything I need to do there?

wary patio