#mr_pablo_85
1 messages ยท Page 1 of 1 (latest)
The line_items field, which includes production info, is expandable by default and therefore not included in the webhook event
You'll need to do a follow-up API request to retrieve them
Is there any way to add the product ID into the event?
I'm not seeing line_items either
As I described, you need to expand (https://stripe.com/docs/api/expanding_objects) the field or use this API: https://stripe.com/docs/api/checkout/sessions/line_items
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
oh sorry, i thought you meant line items was there and I needed to do another call to get more info
Yeah, that is what you'll need to do
so just from the checkout.session.complete webhook event, there is no way to see the product ID?
It requires API calls, correct?
See the code example here: https://stripe.com/docs/payments/checkout/fulfill-orders#fulfill
LIne 34:
const sessionWithLineItems = await stripe.checkout.sessions.retrieve(
event.data.object.id,
{
expand: ['line_items'],
}
);
Correct
๐