#k-nicholas_webhooks
1 messages ¡ Page 1 of 1 (latest)
đ 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/1408455840964415640
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
just adding extra detail: we dont see the last4 in the "checkout.session.completed" event. therefore we are making extra API call to stripe.checkout.sessions.retrieve()
Hi, that is expected as we do not surface Expandable stings: https://docs.stripe.com/api/checkout/sessions/object?api-version=2025-07-30.basil#checkout_session_object-payment_intent
Can you share the id of the Checkout Session so I can see what other options you'd have here?
cs_test_a1dSGCEgshknkDmDvHLy4TC0FHeWIaUb7ahHPCCkT1CZF05bkQzjpCirT8
Can you look at evt_3RyvatRx5jzmxTnn0f5VYYen and see if that works for you?
yeap, that "charge.succeeded" event have the last4 card number.
does that mean we need to listen to 2 event? whats the order of event?
We do not guarantee event ordering: https://docs.stripe.com/webhooks#event-ordering
You can listen to both
btw, is there rate limit per second or any limit that we should be aware for this API "stripe.checkout.sessions.retrieve()"
Yes, we have rate limits: https://docs.stripe.com/rate-limits and we recommend that you listen to events and attain the data needed instead of making GET requests as you scale.
one last question. lets say we listen on both event "checkout.session.completed" & "charge.succeeded".
what is the common id between this two that we could "link" them. is it the payment_intent id (e.g: pi_3RyvatRx5jzmxTnn0Jducrsr). or is there another ID?
i dont see "client_reference_id" in there. or should we store in metadata. which will then be available on both event?
yeah, you can use the pi_
btw i just notice that the metadata value is only populated on "checkout.session.completed", but not populated for "charge.succeeded" event
- evt_1RywWtRx5jzmxTnn1HBUakj7
- evt_3RywWsRx5jzmxTnn0db0sJxp
we set the metadata in "stripe.checkout.sessions.create()"
That is expected as the metadata will not automatically transfer to other objects: https://docs.stripe.com/metadata#copy-metadata
You can pass in the same metadata here: https://docs.stripe.com/api/checkout/sessions/create?api-version=2025-07-30.basil#create_checkout_session-payment_intent_data-metadata on the creation request and that should surface on the charge
sorry, thats what we just did. we added the metadata to "stripe.checkout.sessions.create()"
const session = await stripe.checkout.sessions.create(
{
client_reference_id: cartId,
metadata: {
cartId: cartId,
},
...)
but thats not available on charge.succeeded event
No, you need to set it payment_intent_data.metadata as well
opsss sorry my bad. missed the "payment_intent_data" bit
No problem!
cool. that works. thanks for the help!
Sure