#javier_api

1 messages ยท Page 1 of 1 (latest)

hoary narwhalBOT
#

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

halcyon tangle
#

Hello
Can you share what exactly you're getting as a response?

stable spindle
#

But it's different in the UI

halcyon tangle
#

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?

stable spindle
#

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
}

halcyon tangle
#

So you're getting the amount under tiers

stable spindle
#

Yes, but that amount may be differetn for each subscription

halcyon tangle
#

What amount are you expecting for your usecase - just so that I am on the same page

stable spindle
#

I need to get the 15 USD of this subscription item

halcyon tangle
#

Is there a reason you're trying to get it from the subscription item instead of looking at the invoice that's generated?

stable spindle
#

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

halcyon tangle
#

Subscription Item object doesn't really have an associated amount as such.. It is calculated by the associated price object times quantity..

stable spindle
#

is it the same for mrr?

halcyon tangle
stable spindle
#

Ok, I'll give it a try, thank you so much.