#trace_webhooks
1 messages ยท Page 1 of 1 (latest)
๐ 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/1314231967688032276
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
hi! well yes if you have multiple endpoints on the same Stripe account that listen to the same event types, we send the events to each endpoint.
possible alternatives : use two different Stripe accounts; use a URL that has something like ?product=A and ?product=B for your webhook endpoint and use that to determine if you need to ignore an event or not, depends on the specifics of the problem you're facing.
- Approach => two different accounts makes sense but a strange approach
- How a query will solve my problem? Can you explain it in greater detail? I dont see the benefit if i set an query to my webhook url.
in your code you can check what query param was on the request, so you know which of the two Stripe webhook endpoints is being invoked
you might already know that. It might not help, like I said it depends on the specific problem you're having(which I don't yet have a grasp on)
So i try to explain my problem in greater detail:
In our company we have 2 different products, lets call them product "A" and "B". Of course we have 2 different payment links.
For both products we have 2 different backend servers on different domains that handles the subscription events etc.
For both products we have own webhooks.
Now the scenario:
Customer books a subscription for B => will invoke "customer.created" event => will reach both webhooks. So in worst scenario it can create a customer for product a.
๐ stepping in
As far as i know you can't attach anything you want on a payment link, it is limited to your dropdown options.
What Events are you specifically using here?
And what action are you taking based on the Event?
Most likely you are going to want two different accounts if you are using Payment Links here since you have very little control over the objects that are generated.
But it is possible that you could use metadata to distinguish, depending on what Event types you are relying on.
Yeah, that is what i thought, thanks for your patience.
But do you agree it is a little bit silly that webhooks are not able to filter products :D? Strange development decision. Its not that hard to implement.
This is a pretty typical way that Webhooks function. I don't think it is silly, no. I think it is a fair feature request but that's just not how Stripe Webhooks work.
That said, you can set metadata on your Products and then filter in your endpoint code. That is basically the same premise.
To your question. We listen on events like:
customer.created => adds a db entry for customer
invoice.paid => sets a datetime how long the subscription is valid
Yeah thanks a lot dude!
Great job! I love most of your integrations, cli, docu. But on webhooks, i still miss this feature ๐
have a nice day!