#localbrownboy_api
1 messages ยท Page 1 of 1 (latest)
๐ 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/1298418878829035520
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi there
Hello :)
I see this SubscriptionItem is using a Price that uses billing_scheme: 'tiered', This means there is no unit_amount
You'll need to look at the Price's tiers
So seperate request to price with whatever id and then there will be a cost per tier?
If you're retrieving the Subscription, you can use expansion to automatically expand the tiers for the price: https://docs.stripe.com/api/subscriptions/object#subscription_object-items-data-price-tiers
sorry you lost me there.
I have this current subscription object:
is this incorrect?
tiers under items.data.price is not automatically included in the response
If your goal is to look at the amounts under tiers, you should use expansion: https://docs.stripe.com/expand
okay, i get what you are saying, I will implement that
thank you very much :)
Take care, I will return if i have any more questions
Sure thing, happy to help!
oh one more question, I am currently using this endpoint https://docs.stripe.com/api/subscriptions/list
with a query set on the prices.
I cannot change this as its being used in many places, is there a way for me to add the expand on it?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ah, no, this won't be possible
Not because list calls don't support expansion but because expansion can only be done four layers deep
I can make a seperate call to get the tiers off a price
so v1/prices/id
but then thats a get request
how do i expand off a get request?
Right, you'll need to make a separate call to get the Price
In a similar way. you'd pass something like expand=['tiers']