#drewdan_usage-tiers
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/1280919575961141278
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
Do you have an Invoice ID I can look at?
I was following this guide:
Which reads as if the first anything under the first tier would never be charged, and anything ove would, but I am not sure this is right
these are my tiers
and this is the invoice it generated:
any tips you could give would be amazing 🙂
oops, sorry, I missed this: in_1PvKpUJbBfypbb7ZbAPmJiHy
it's in test mode
Can you list the steps you took to get here and why you're expecting the amount to be exactly 50?
The idea with this is, we have "interactions" in our system. A user gets a certain amount as part of their subscription, and then anything above this limit is charged per interactions.
So I have a product and a price for the core subscription, which is a flat rate either monthly or annually.
Then I have a product called Interactions which is tiered, with the first 100 interactions being charged £0.00 and then anything over 101 or more at £0.50
I have a meter setup, which is assigned to this price and then I report the usage via the API in my application.
The limit for this plan is 100 interactions, so I thought, it would only start charging £0.50 after interaction 101
and as there are 101 interactions, the first 100 are free, so should total £0.00, and then the one additional one should be £0.50
if that makes any sense
the invoice is certainly £0.00 when the Qty is 100
does that provide you enough context?
I think so. Apologies for the wait here. Meters are a relatively new product and the server is rather busy. I'm digging in now
Okay, so I think I see what's happening. You setup a tier that bills after usage exceeds 100. You reported usage for 101 units, which means they are getting billed for (100 x 0.50) + 0.50
Once that usage amount is reached, the customer is billed for all the usage up to that point, plus the one unit of usage that was reported over 100 (e.g. the 101st unit that was reported)
Does all that make sense so far?
drewdan_usage-tiers
@craggy plover I think you want to look at tiers_mode: 'graduated' in that case. See https://docs.stripe.com/products-prices/pricing-models#tiered-pricing for more details
yes this makes sense so far - and no worries about the wait, I can see it's pretty busy in here
Can you see my price if I share the ID: price_1PvKbeJbBfypbb7Z12aUHpe5
seems I cannot share the code in here I am using to create the product, and price, but hopefully you will be able to see the data from this.
I am currently using graduated pricing
$stripe->prices
->create(
[
'product' => $interactionProduct->id,
'billing_scheme' => 'tiered',
'currency' => 'gbp',
'recurring' => [
'usage_type' => 'metered',
'interval' => 'month',
'meter' => $interactionMeter->id,
],
'tiers_mode' => 'volume',
'tiers' => [
[
'unit_amount' => 0,
'up_to' => 100,
],
[
'up_to' => 'inf',
'unit_amount' => 40,
],
],
// might have to make some changes to make the webhook use the product metadata, not the price
'metadata' => [
'internal_name' => 'month' . '-' . strtolower($key) . '-overage-2024-05-23',
],
],
);
ah here we go
so the product has a name of Interactions, and this is the only associated price
what does "a name of interactions" mean? Can you share an exact Price id
yeah you use tiers_mode: 'volume' for that Price and not tiers_mode: 'graduated' like I recommended