#javier_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/1290760623977660449
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello
Can you share what exactly you're getting as a response?
Sorry the API request you shared is to retreive price object using Prices API endpoint and the result you shared is for a Subscription Item which uses a different endpoint..
Can you share the correct request ID or response?
Like https://dashboard.stripe.com/logs/req_89sfA1QTWe8WMm should've returned a price object
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
I noticed I need to get the price at subscription item level, not at price level, that's why i sent a different response, but here is the other one
<Price price id=price_0OXU47sSlifq3EccICFRP1IG at 0x106122ab0> JSON: {
"active": true,
"billing_scheme": "tiered",
"created": 1705001843,
"currency": "usd",
"custom_unit_amount": null,
"id": "price_0OXU47sSlifq3EccICFRP1IG",
"livemode": true,
"lookup_key": "plan/starter_v2/month",
"metadata": {
"ItemCode": "price_0OXU47sSlifq3EccICFRP1IG",
"TaxCode": "SW053003",
"netsuite_service_sale_item_id": "31365",
"netsuite_service_sale_item_link": "https://800673.app.netsuite.com/app/common/item/item.nl?id=31365"
},
"nickname": null,
"object": "price",
"product": "prod_PMCTpY24N34hig",
"recurring": {
"aggregate_usage": null,
"interval": "month",
"interval_count": 1,
"meter": null,
"trial_period_days": null,
"usage_type": "licensed"
},
"tax_behavior": "unspecified",
"tiers": [
{
"flat_amount": null,
"flat_amount_decimal": null,
"unit_amount": 1500,
"unit_amount_decimal": "1500",
"up_to": 3
},
{
"flat_amount": null,
"flat_amount_decimal": null,
"unit_amount": 4600,
"unit_amount_decimal": "4600",
"up_to": null
}
],
"tiers_mode": "graduated",
"transform_quantity": null,
"type": "recurring",
"unit_amount": null,
"unit_amount_decimal": null
}
So you're getting the amount under tiers
Yes, but that amount may be differetn for each subscription
What amount are you expecting for your usecase - just so that I am on the same page
Is there a reason you're trying to get it from the subscription item instead of looking at the invoice that's generated?
I was trying to replicate a code I found for MRR, it's just weird that I can't take this value from the object I soupose it's displaying the data
Subscription Item object doesn't really have an associated amount as such.. It is calculated by the associated price object times quantity..
is it the same for mrr?
I'm not familiar with how MRR is calculated tbh but we have a doc that talk s about how you can calculate this - https://docs.stripe.com/billing/subscriptions/view-metrics#monthly-recurring-revenue-(mrr)
If i understand the doc correctly, it seems to be calculating based on the amount you collect from an active subscription.. which is reflected by the invoice..
Ok, I'll give it a try, thank you so much.