#Eli P-connect-webhook

1 messages · Page 1 of 1 (latest)

bright narwhal
#

Hello 👋
Just to make sure I understand the question correctly, do you want to receive connect and non-connect type events on the same webhook endpoint?

sick valve
#

Yes

#

Will there be any duplicates if two webhooks are created, one direct and one connect

#

Same endpoint

bright narwhal
#

We generally recommend keeping the endpoints separate as you'd need to take extra steps to identify each event (if it originated from platform account vs connected account) etc

#

not sure I fully understand duplicates context in your question, do you have an example in mind?

#

Account webhooks are for activity on your own account and Connect webhooks are for activity on any connected account.

If you keep the endpoint same, you'd probably receive both types of events.

sick valve
#

Meaning is there any overlap in the events that they send or can I be certain that all events one triggers the other won’t and vice versa

#

I just don’t want to get duplicate events

bright narwhal
#

as far as I can tell, no. You shouldn't receive the same event twice

sick valve
#

Meaning if I add a Stripe-Account header of my primary account then only webhook one will fire?

bright narwhal
#

When you add Stripe-Account header, you're making a connect request. So yeah I'd assume it would only trigger once

#

I'd recommend giving it a try in test mode to be 100% certain

sick valve
bright narwhal
#

Not all events would have a Stripe-Account header though

sick valve
#

Then they would be for the platform account, no?

#

So I can just default them to the platform account

#

Am I getting something wrong here?

formal patrol
#

no your understanding is correct

#

If you have an Account webhook endpoint A for your platform and a Connect webhook endpoint B for your connected accounts, then all events on your platform will be sent to A and have no account property, and all events on connected accounts would be sent to B and have account: 'acct_123' set

#

you can use the same URL for both A and B and use the presence/absence of account if you want. Personally I like putting something like a query param in the URL to distinguish between the two at least

sick valve
#

And if I have Stripe-Account to my primary platform account, which webhook fires?

formal patrol
#

That doesn't really make sense as a question

sick valve
#

Why? Let’s say I add a header of Stripe-Account to my primary account in the api request? Your saying then no header is sent from the webhook?

formal patrol
#

you're misunderstanding it all and going too fast

sick valve
#

I’m pretty sure I have sent my platform account in the Stripe-Account header before. Your saying that call would fail?

terse belfry
#

Hi! The request wouldn't fail, but it's just not necessary because you're already using your platform's API key. The Stripe-Account header in the API request is only required if you are making calls for the connected account.

sick valve
#

I understand that. I’m just asking which webhook would fire if I do. The connect one or direct one

terse belfry
#

Ah, the direct one would fire in that case.

sick valve
#

Thank you. Was just trying to make sure that no events overlap from direct vs connect webhooks as I am attaching both of them to the same endpoint and don’t want duplicated events.

terse belfry
#

Yep, that's correct!