#napolean-solo_api

1 messages · Page 1 of 1 (latest)

vague summitBOT
#

👋 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/1475739711606882448

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

final onyx
#

??

drowsy totem
#

hello! can you elaborate more on what you mean by you want totally different webhooks and events for this specific product? Can you illustrate with an example?

final onyx
#

Like I have an existing product and I am selling that product to a set of customers and receiving webhook events

Now I want to create a completely new product for a new set of customers that’s completely different from the one above

#

How can I separate the events and webhooks as this product has a completely different backend

drowsy totem
#

there's no straightforward way to separate these in Stripe. Stripe doesn't allow you to configure separate webhook events / webhook endpoints for a specific product. If you want to handle a specific product events separately, that's something you need to handle within your own server by identifying that specific product is being used

final onyx
#

And how can that be done

drowsy totem
#

how are you accepting payment for that product? Are you using Checkout Sessions API?

final onyx
#

Yes

drowsy totem
#

since you'll know what product the customer is choosing before creating the Checkout Session, you can include metadata in the Checkout Sessions and filter the events based off that metadata

If you pass in the metadata in https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-metadata, only the Checkout Session object will contain the metadata.

If you pass the metadata into subscription_data.metadata (this is for mode="subscription") - the Subscription will contain that metadata, and so will the Invoice Line Items : https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-metadata

If you pass in the metadata into payment_intent_data.metadata (this is for mode="payment") - the PaymentIntent will contain that metadata : https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-payment_intent_data-metadata

You'll likely want to pass the metadata into the Checkout Session object, and either subscription_data or payment_intent_data
This is all very high level still since I don't know what specific events you're listening for and want to process, but should be enough as a start

final onyx
#

What about for invoice?

#

Invoice related events?

drowsy totem
final onyx
#

But that’s for line item

#

What about invoice. paid created updated

drowsy totem
#

The invoices will contain the metadata, you can test it out and see