#Alpha-kr
1 messages · Page 1 of 1 (latest)
Hello, you can pass that identifier in as metadata, though you may have to retrieve the checkout session in your webhook event handler code to be able to see it again. I forget if metadata is included with the initial event data https://stripe.com/docs/api/metadata
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
In sumary I have something like a global product that my users can buy but this global product is related with another entity, that is I need away to indentify the related entity and I dont want to create the same product with the same price for each entity
did I make myself clear?
it's like a relation one to many
I think that makes sense. So yes, in this case metadata would probably be a great way to indicate which entity the product is for here
yes but there are many entities
related to only one product in stripe
I mean for example I have 3 entities but theses for stripe is one product because is the same image, price etc
Gotcha, I more meant setting metadata on the checkout session or payment intent, not on the product itself
yes
but it has to be dinamic
for example I buy product A but this product is related with entity A entity B and entity C
in the checkout Im paying product A but I need to know what entity is buying too
Do you know what entity is involved when you create the Checkout Session?
You can listen for the checkout.session.compeleted webhook event, if you set metadata on the Checkout Session about which entities are involved, that should show up on the event or for that checkout session https://stripe.com/docs/payments/checkout/fulfill-orders