#krishna-awate_webhooks

1 messages · Page 1 of 1 (latest)

glacial estuaryBOT
#

đź‘‹ 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/1355168854241837066

📝 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.

heavy patio
#

Hi, are you manually making requests to unpause the subscription?

minor pewter
#

Yes

#

Through dashbaord

#

Want to pause subscription. Can I do using this option --> Pause Payment Collection?

In documents --> customer.subscription.paused
data.object is a subscription
Occurs whenever a customer’s subscription is paused. Only applies when subscriptions enter status=paused, not when payment collection is paused.

#

How can I test puase & resume events?

heavy patio
minor pewter
#

When I resume subscription. Payload for charged and resume is same. How can I know which one is for resume?

heavy patio
#

If you update the subscription with the metadata, you should be able to attain that level of information on the update event after you pass the metadata

Also, can you share the two events from the pause/ unpause actions please?

minor pewter
#

customer.subscription.paused

customer.subscription.resumed

#

but when this events hit I am able to see only customer.subscription.updated

I am missing anything? or not pausing subscription in correct way?

heavy patio
#

No, that is how it works. Since you're listening to customer.subscription.pausedand customer.subscription.resumed does not that solve your problem and telling you exactly what happened?

#

If not, what are you looking to see exactly?

minor pewter
#

When subscription is paused

  1. I want to send email to customer and admin same for resumed
  2. want to store some data when paused and resumed

To do that I want to trigger paused and resume webhook but not able to trigger these. Instead of this subscription.udpated event is triggering.

heavy patio
#

Can you share a concrete example subscription please?

#

You can share the sub_ id with me when customer.subscription.paused was not triggered when expected

minor pewter
#

sub_1R7dceDBfYojrB0W7yJu4LOr

heavy patio
#

As, that is because you're pausing the collection and not pausing the subscription. We document that here: https://docs.stripe.com/api/events/types#event_types-customer.subscription.paused

Only applies when subscriptions enter status=paused, not when payment collection is paused.

On the update event, you can look at:

previous_attributes: {
canceled_at: 1743171059,
pause_collection: null
}

and compare it to the the current

pause_collection: {
behavior: "keep_as_draft",
resumes_at: null
},

#

Can you try that?

minor pewter
#

if (event_data?.pause_collection) {
isSubPause = true;
} else {
isSubPause = false;
}

I have used this logic to find out susscription is paused or resume

but there is one problem below:
pause_collection is null for both invoice paid (subscription.updated triggers when invoice is paid) and subscription resume, so how can I identify resume?

#

customer.subscription.updated is being triggered for invoice.paid and customer.subscription.resumed and both having pause_collection: null

heavy patio
#

Pausing the collection does not make the subscription status to pause:

https://docs.stripe.com/billing/subscriptions/pause-payment

Subscriptions with paused collection can’t move into status=paused. Only ending free trial periods without a payment method cause subscriptions to enter a paused status.

#

Can you share customer.subscription.resumed event with me? It should start with evt_

minor pewter
#

How to see?

heavy patio
#

Let's step back. The subscription status:paused and the pause_collection are separate.

minor pewter
#

Okay got it

#

api_version =
'2022-11-15'
created =
1743172787
data =
{object: {…}, previous_attributes: {…}}
id =
'evt_1R7e4VDBfYojrB0WsC2wIIeE'
livemode =
false
object =
'event'
pending_webhooks =
1
request =
{id: 'req_gE3zBGrGiKzYfk', idempotency_key: 'cd047c05-54e6-4697-94ff-6a095b3598dd'}
type =
'customer.subscription.updated'

heavy patio
minor pewter
#

id ='evt_1R7e4VDBfYojrB0WsC2wIIeE'

#

How to trigger pause subscription?

#

Want to test pause but not able to trigger

heavy patio
#

You can see that the precious attributes show it correctly:

previous_attributes: {
canceled_at: 1743171124,
pause_collection: {
behavior: "keep_as_draft",
resumes_at: null
}
}

minor pewter
#

Yes but for resume it is null

heavy patio
#

I can't help you with Dashboard behavior. This channel is for developers with technical questions with the API.

You can't explititely update that. We document how subscriptions work here: https://docs.stripe.com/billing/subscriptions/overview

You see this status when a subscription is configured to pause when a free trial ends without a payment method. Invoicing won’t occur until the subscription is resumed.

Manage recurring payments and subscription lifecycles.

minor pewter
#

Okay but I am haiving issue to identify resume payment collection as pause_collection is null for resume payment invoice paid

heavy patio
#

Can you please review the above documents carefully first? Then, when you have specific questions I'm happy to assist further

minor pewter
#

Sir my question is that subcription.update trigger on both inovice.paid and resume payment collection. I want to identify which one is resume.

if i depend on pause_collection then it is null for both inovice.paid and resume payment collection.

#

In that case how can I identify which one is resume payment collection.

heavy patio
#

Can you share the events from the pause_collection that show null for both in the previous attribute?

minor pewter
#

For resume payment collection id is 'evt_1R7eDoDBfYojrB0WrzEc2F8N'

heavy patio
#

That is because you're resuming so that will be null.

#

Otherwide, you're not resuming it

minor pewter
#

same pause_collection : null when invoice.paid

evt_1R7eKYDBfYojrB0WJ60HpTfD

heavy patio
#

You can look at the previous attributes:

previous_attributes: {
canceled_at: 1743173348,
pause_collection: {
behavior: "keep_as_draft",
resumes_at: null
}
}

#

This confirms that it was previously paused on collection, and not since the collection is null, it's resumed

minor pewter
#

not able to find previous_attributes in payload

#

Okay I found

#

I got you sir.

#

I will do that

#

Thank you so much for your help