#Nick - webhooks

1 messages · Page 1 of 1 (latest)

obtuse gale
#

Stripe will generate events for everything. It's up to you to tell your webhook which events you want sent

#

It's recommended to explicitly only configure your webhook endpoint to send the events you need (not all events)

forest pollen
#

I'm more asking about multiple events of the same type

#

For example, adding a sub item fires customer.subscription.updated but updating the subscription metadata also fires that same event. If you do the 2 in quick succession it gets weird in the handler

obtuse gale
#

Ah no. You could set some metadata on the request and use that to ignore the event

#

But no more explicit way

forest pollen
#

As in just a metadata value for the entity we're updating? Or is there a more generic "Event" metadata value?

#

Or even a way to know what the event ID is going to be for such an update?

#

the latter may be a chicken and egg problem

obtuse gale
#

Just metadata for the entity you're updating

#

No way to know the id

forest pollen
#

Quick follow up question then - sort of unrelated, we can open a new thread if necessary

obtuse gale
#

You can ask in here

forest pollen
#

I can update subscription items via the subscription update method (rather than explicitly calling subitem.New, and then adding the trial). Do I have to pass through the existing ones, or can I just pass through the new item?

#

Is it like metadata where not sending the value has no effect? Or do you explicitly have to tell it exactly which items you want each time you update?

obtuse gale
#

I don't know 100% off the top of my head but I believe you have to specify existing items. I recommend testing this out in test mode