#jdesignv2_api
1 messages ¡ Page 1 of 1 (latest)
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- jdesignv2_error, 2 days ago, 23 messages
- jdesignv2_best-practices, 3 days ago, 9 messages
đ 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/1241096934379491430
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
Sorry for asking a lot of questions this week ^^
It's not clear to me what exactly you mean here. We do not expand the Checkout Session line items by default, you need to retrieve them from the API.
I don't know what command you are referring to
ok sorry let me clarify my question...
So normally I use the following command for retrieving the checkout session:
let checkoutSession = await stripe.checkout.sessions.retrieve(
checkout.id,
{
expand: ["customer",
"payment_intent",
"line_items",
"line_items.data.price.product",
"invoice"
],
}
);
This works perfectly fine until I have more then 10 line_items in one checkout session... Which makes sense for Stripe but makes it a bit more complicated for my use-case...
So now I found out that you can retrive all line_items of a checkout session with the stripe.checkout.sessions.listLineItems() command. Which works - but only gives me the product-ID of each product (in line_item->price->product)... So do I need to explicitly call await stripe.products.retrieve() for each line_item or is there a method of expanding the line_item result before - like when receiving the checkout session...
I hope my question is now more clear
English is not my main language :/
Okay ,no that makes sense.
The list line items function is just another API call, like the retrieve method.
So i just tested out passing expand=['data.price'] to my call to list_line_items (I'm using Python)
oh so I can also add the expand: [] param to the stripe.checkout.sessions.listLineItems() call?
Correct!
ahhhh nice