#a__.

1 messages · Page 1 of 1 (latest)

spark meteorBOT
vapid latch
#

Hi there, what's the event ID?

true tusk
#

I don't really have a specific event id, I just want to know whether it's possible I get the event with this :

case 'customer.subscription.deleted': {
                const subscription = event.data.object as Stripe.Subscription;
...
#

customer.subscription.deleted is the webhook triggered

vapid latch
#

I don't quite understand your question, are you asking if the event data in 'customer.subscription.deleted' is of type subscription ?

true tusk
#

Ok so when a user cancels a subscription, I update it so the cancel_at_period_end = true. So the subscription will end at the end of the subscription period.

#

I wanted to know if the deletion of the subscription was triggered automatically at the end of the period or with a cancel call

vapid latch
true tusk
#

For the manual call yes

#

The manual cancel call is triggered when a user doesn't start the subscription. They just went to checkout but didn't complete the checkout.

vapid latch
#

If you use that API to cancel the susbcription, the susbcription would be cancelled immediately.

true tusk
#

Yeah I know but the thing is I am using webhook events

#

If I use the API it would also trigger customer.subscription.deleted event

#

I wanted to know how can I differentiate between an API cancel and a Stripe triggered cancel at the end of subscription period

#

I hope it's clear

vapid latch
#

Let me rephrase the question, so you want to know if the subscription is cancelled at peroid end, or cancelled by the cancellation API call?

true tusk
#

Yes exactly

vapid latch
true tusk
#

So the value should still be true after deletion?

vapid latch
#

If you call the cancellation API to cancel the subscription, the cancel_at_peroid_end would be false.