#normanlove_checkout-event-metadata

1 messages ยท Page 1 of 1 (latest)

narrow cargoBOT
#

๐Ÿ‘‹ 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/1498366513105600756

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

ornate onyx
#

HI ๐Ÿ‘‹

I"m a little confused what you mean here. Are you creating the Checkout Sessions on a different account and you are not receiving those events? Or do you want two separate apps to receive the same events?

#

Also, what do you mean by "apps"? Are these separate Web applications? Stripe Apps?

fast summit
#

yes, 2 seperate web applications. I want 2 seperate apps to receive receive the checkout.sessions.completed and let their respective websites know it was fired and they handle things their own way.

ornate onyx
#

Okay but the Checkout Sessions are still created on the same Stripe account, correct?

fast summit
#

we had the 1st site setup with a webook and it workd and we had not setup the webhook for the 2nd site yet, but when testing the payments for the 2nd it fired the 1st, and then claude is saying that whenever there is a checkout for the accout it will fire all the webhooks listening to that, and thats the issue

ornate onyx
#

Let's ignore what claude said

fast summit
#

yes checkouts sessions are on the same stripe accounts, cause its the same business

ornate onyx
#

So any Checkout Session created/confirmed on that account will send a webhook event to the one endpoint you have registered

fast summit
#

one app is the CRM that can send clients products to pay for and the other app is an offering that sells reports

ornate onyx
#

If you want your second app to receive this information too, you need to create a new webhook endpoint for that app

#

But both will receive EVERY checkout.session.completed event

fast summit
#

we will eventuall have 2 endpoints

ornate onyx
#

So, if you don't want to create a new Stripe Account, you will need to handle event filtering on your end

fast summit
#

that is the issue. so a business can't have 2 payment apps that are both looking for a checkout completed ?

#

how do we handle the event filtering on my end? whats the best practice on that. any documentation?

ornate onyx
#

You can, if you handle the filtering on your end

#

E.g. add some metadata key:value pair that identifies the events your app should care about

fast summit
#

add meta data how, where, example?

ornate onyx
#

But if you want each app to only receive the events that are specific to that app, you will need a separate Stripe account

#

Metadata is a core part of our API designs and most Stripe APIs include that as a parameter

fast summit
#

OK, I see, when the API keys are sent, we add a metadata like "app1" to what is sent, right? I see that. And that meta data will be returned when the webhook is triggered?

ornate onyx
#

OK, I see, when the API keys are sent

I don't know what you mean by that. You set metadata when you make a Create or Update request via the API. For creating a Checkout Session it is one of the parameters we list here.

That key:value pair is then available on the Checkout Session object, which is part of the webhook response data you get. So your app could check the metadata property to see if the value matches what it expects. If it does, your app processes the information. If the value is for a different app, it ignores it.

fast summit
#

this is the perfect solution I was looking for. Yoou guys continue to be the best support on the planet. thank yoou so much! ๐Ÿ™ have a great day

ornate onyx
#

I'm glad we found a simple way to address the issue. Have a good one!