Discussions

Ask a Question
Back to All

Webhook Events: Reference number to update my database record

Hi!

I am using the Checkout API and able to receive the json payload in my webhook (checkout_session.payment.paid, payment.paid, payment.failed). Now that I have to update the status in my database, I checked the json payload and there is no reference number I can use to update the record in my database even though initially in creating a checkout session I clearly put one.

Is it safe to use the payment_intent_id as a reference number? Because I think this is the only unique id I can store when I create a checkout session and also use it later when receiving a json payload in my webhook.

Thank you in advance!