#axelvaindal
1 messages ยท Page 1 of 1 (latest)
Stripe has legacy integration using plan instead of price
It's possible that price to be null
Alright, thanks for your answer.
In the same spirit, in the documentation, it is said there is a way to fetch a limited amount of line items at the same time than we retrieve the session, but I cannot find any docs with example, can you clarify ? ๐
In Checkout Session, the number of line items returned can be limited. /v1/checkout/sessions/:id/line_items can be used to retrieve the full list with pagination:
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.
Sorry, I'm not sure I understand.
From my understanding, by default, Stripe Checkout Session are not retrieved with line items.
From my screen above, there is a way to add limited number of line items to response, and if need be, there is a dedicated endpoint to fetch all line items.
My question is, how to customise the retrieve call to include the limited line items property ?
const session = await Stripe.checkout.sessions.retrieve(sessionId); // no line item by default
const { data } = await Stripe.checkout.sessions.listLineItems(sessionId); // paginated list of line items for the session
const sessionWithLineItems = await Stripe.checkout.sessions.retrieve(sessionId, {)); // which params should be passed here to include line items and avoid doing two api calls ?
You use expand: Stripe.checkout.sessions.retrieve(sessionId, { expand: ['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.
Works like a charm! Best dev support I have ever seen, thank you for your help! ๐