#gabriel-felipe-gianesini_api

1 messages · Page 1 of 1 (latest)

glacial lightBOT
#

👋 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/1229502073184325633

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

rare arrowBOT
#

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.

scarlet cradle
#

Hey @undone creek ! I'm sorry but I can only help in English here. Can you explain what your question is in English exactly?

undone creek
scarlet cradle
#

you want expand%5B%5D=line_items.data I think

rare arrowBOT
undone creek
#

yes

#

Do I need to return everything or just part of the price

subtle token
#

Can you click on the headers tab of that request and send me the request ID (req_123) header from it?

#

When expanding line_items.data the items in that the call returns will have the full price object

undone creek
#

in this case I am not passing an id

undone creek
# undone creek

para utilizar o line_itens eu passo o parametro expand na query ? ou no body? o expand no caso é um array de objeto? ou um array de string mesmo?

subtle token
#

The request ID is something that Stripe returns to you in the HTTP headers of our response

#

expand is a String array that you pass in the body the same way you pass other parameters

undone creek
#

req_awr9bnm8dZmesG

#

req_awr9bnm8dZmesG?t=1713206329

subtle token
#

Ah, it looks like you are passin " expand" as the parameter name, there is a space before the e, so our backend doesn't recognize the parameter name. If you get rid of that space the call should work

#

It looks like you otherwise passed the parameter properly, it is just that space character in the parameter name that is throwing things off.

undone creek
#

return erro req_Jwj9ARF2AlP4d4?t=1713207660

#

I removed the white space but it seems like it didn't resolve the issue

subtle token
#

That is a different error message. It looks like postman is passing the entire array as a string

#

Can you try setting the parameter name to expand[0] and then just pass the string line_items.data as the value?

#

I think with postman you need to send array items individually like that

undone creek
#

ok, I'm checking

#

Thank you, I did it, you are top

#

The error is elsewhere, I was passing it backwards

#

documentation is confusing

#

the documentation says the opposite of what the api expects

#

Or I can't understand, I don't understand hahaha

subtle token
#

Apologies, that was my confusion. You are right that I told you the wrong thing, but the doc is also correct here.
We use arrays named data to store arrays like this. You are listing Checkout Sessions, so that list of sessions comes in an array named data, those sessions have a list of line items and those line items are in a different array named data.
You would have to specify that if you wanted to expand a specific field within those line items. For example if you wanted to expand the discounts property on each of these line items you would pass expand=['data.line_items.data.discounts'].

#

Does that make sense? This is a definitely a confusing concept at first

undone creek
#

Oh good, I understand

#

yes, it makes sense. Thanks