#Eli P-connect-webhook
1 messages · Page 1 of 1 (latest)
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?
Yes
Will there be any duplicates if two webhooks are created, one direct and one connect
Same endpoint
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.
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
as far as I can tell, no. You shouldn't receive the same event twice
Meaning if I add a Stripe-Account header of my primary account then only webhook one will fire?
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
I plan on just defaulting to the platform account if no header is present (which I originally assumed was the default)
Not all events would have a Stripe-Account header though
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?
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
And if I have Stripe-Account to my primary platform account, which webhook fires?
That doesn't really make sense as a question
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?
you're misunderstanding it all and going too fast
1/ There's no header on webhook. We don't send a header, it doesn't make sense. There's the account property on the Event https://stripe.com/docs/api/events/object#event_object-account
2/ When you make calls on the connected account, you pass the Stripe-Account header (https://stripe.com/docs/connect/authentication#authentication-via-the-stripe-account-header) set to the id of the connected account. This can never be your own platform account
I’m pretty sure I have sent my platform account in the Stripe-Account header before. Your saying that call would fail?
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.
I understand that. I’m just asking which webhook would fire if I do. The connect one or direct one
Ah, the direct one would fire in that case.
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.
Yep, that's correct!