#paulc7053_api

1 messages ยท Page 1 of 1 (latest)

neon merlinBOT
#

๐Ÿ‘‹ 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/1377019425437388822

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

graceful sandal
#

hey!

#

Here's how I try to get the prices // Get the existing price for this product const prices = await stripe.prices.list({ product: productId, active: true, type: 'recurring', limit: 100 }); console.log({productId ,prices: prices.data}); const matchingPrice = prices.data.find(price => price.currency === stripeSubscription.currency );

#

but there are always 10 prices, even though in my dashboard I clearly have 14 prices

stray creek
#

Hi there ๐Ÿ‘‹ do you have an example of a Price that isn't being returned when you make a list request? My suspicion is that they're Prices that were created from price_data, and so they were immediately made inactive and can't be reused.

graceful sandal
#

Hello!

#

from my requests it seems to be quite random to be honest..

#

for example Im testing now with USD. most of the times its not returned, but sometimes is...

stray creek
#

What is sometimes returned, a specific Price object?

graceful sandal
#

yes

#

but always up to 10

#

this is how I create the prices

#

const newPrice = await stripe.prices.create({ product: productId, unit_amount: unitAmount, currency: currency, recurring: { interval: 'year' }, metadata: { tier: tier.toLowerCase(), environment } });

stray creek
#

I'm going to need some more specific context.

Can you make another list request, and capture the request ID that the request generates, and share that with me? https://docs.stripe.com/api/request_ids
Please also log the output of the request (we don't log the output of GET requests, so I won't have visibility into what you see).
In that output, what is an example of a Price object that you expected to see returned, but didn't?

graceful sandal
#

yes, 1 min please

#

Here you can see there are only 10 prices returned and the req id

#

{ prices: { object: 'list', data: [ [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object], [Object] ], has_more: false, url: '/v1/prices' } } req_U9ijbfbQHGZb1Z

#

Hm

#

now's 14 indeed

#

Oh my.

#

this makes no damn sense.

#

This is so weird, why could it now work as expected but previously not?

stray creek
#

Really hard to speculate about that without specific Price IDs.

graceful sandal
#

I understand

#

Should I be concerned about this, or look more into it....?

stray creek
#

That's largely up to you. I don't have a sense of what would have changed in your tests from before you started speaking with me to now. So I don't have a great sense of whether previous requests were malformed, or the response wasn't parsed correctly, or something was wrong on our end.

My sense is that if this bugged you enough to reach out to us, that you should work to ensure you're comfortable with how our system behaves and are confident that it's behaving consistently.

graceful sandal
#

yes, that's right

#

I mapped over them and they werent 14, but 10

#

I'll look into it more

#

Thanks a lot @stray creek !

stray creek
#

Any time!