#lostoros - charge and product

1 messages · Page 1 of 1 (latest)

deft lagoon
#

hey there, how are you creating these payments? Are you referring to Checkout?

flint pier
#

The payments are generated from the payment links created using the dashboard

#

The end goal is to have a table for each product and populate it with the customers that bought the product and the quantity

deft lagoon
#

Got it - so yea, payment links make use of Checkout sessions that are created for you

#

and where are you trying to access this data? you said via the API?

flint pier
#

Yes the API

deft lagoon
flint pier
#

Yes this is very helpful thank you!
The solution I have in mind is to create a webhook for a successful checkout session >> request the session from with the expanded line_item >> the session contains the customer id which I can use to get the customer info.

  1. based on your knowledge of the system does this sound possible?
  2. Does the webhook contain the event id? for example with the checkout session : "cs_...."
deft lagoon
#

Yes and yes 🙂

#

THat's a good approach for handling this and yes the checkout.session.completed event will have the checkout session id in the payload -- the data object is a checkout session object

flint pier
#

Perfect, thank you so much! I have been struggling with this since last night

deft lagoon
#

happy to help, hope it cleared some stuff up for you!