#bommerhond_unexpected
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/1220354595256275065
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
I'd like to get the last unit number from the API per tier
Hi there
Taking a look
You are saying that when you retrieve the Price and look at tiers.up_to (https://docs.stripe.com/api/prices/object#price_object-tiers-up_to) it is null?
yes
"type": "recurring",
"tiers": [
{
"flatAmount": "0",
"flatAmountDecimal": "0",
"unitAmount": null,
"unitAmountDecimal": "0.1",
"upTo": null
},
{
"flatAmount": "0",
"flatAmountDecimal": "0",
"unitAmount": null,
"unitAmountDecimal": "0.2",
"upTo": null
}
]```
This is the response I get from the API call
Can you share the relevant Price ID?
"id": "price_1OjNmeLlh05zOyrhVXtJFMkD",
"active": true,
"type": "recurring",
"tiers": [
{
"flatAmount": "0",
"flatAmountDecimal": "0",
"unitAmount": null,
"unitAmountDecimal": "0.1",
"upTo": null
},
{
"flatAmount": "0",
"flatAmountDecimal": "0",
"unitAmount": null,
"unitAmountDecimal": "0.2",
"upTo": null
}
]
}```
Looking
Hmm I do see upTo set on that Price. Can you show me how you are retreiving the Price?
$prices = $this->stripeClient->prices->all(params: ['expand' => ['data.tiers']]);
using Stripe's PHP client
Hmm okay one min let me see if I can reproduce
Hmm strange, works just fine for me.
However I'm using the Node SDK
What version of the PHP SDK are you using?
13.12.0
I just did the same with the PHP SDK and works as well.
Can you try creating a brand new tiered Price and test again?
yeah sure
Same issue
"id": "price_1OwlYRLlh05zOyrhY1W61EnT",
"active": true,
"type": "recurring",
"tiers": [
{
"flatAmount": null,
"flatAmountDecimal": null,
"unitAmount": null,
"unitAmountDecimal": "0.5",
"upTo": null
},
{
"flatAmount": null,
"flatAmountDecimal": null,
"unitAmount": "2",
"unitAmountDecimal": "2",
"upTo": null
}
]
},```
oops, sent too many images ๐
Why does your response use camel case? The response from our API should be in JSON using snake case here.
Like I see: "tiers": [ { "flat_amount": null, "flat_amount_decimal": null, "unit_amount": 100, "unit_amount_decimal": "100", "up_to": 1000 }, { "flat_amount": null, "flat_amount_decimal": null, "unit_amount": 200, "unit_amount_decimal": "200", "up_to": null } ],
For my example