#voidy_subscription-items

1 messages ¡ Page 1 of 1 (latest)

sleek brambleBOT
#

👋 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/1280567940995092491

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

clear raven
#

voidy_subscription-items

#

@slate pilot A Subscription sub_12345 has the items property which contains the Price(s) associated with that Subscription. If you look inside items.data[0][price] you get the full Price object https://docs.stripe.com/api/prices/object.
Unfortunately this does not contain all the associated Product's information. Instead it just has the Product id product: 'prod_123456'.
What I recommend personally is to cache this in your own database directly to simplify the reconciliation.

But if you want to get the data from Stripe, it will never be in the Event. Instead, you'll have to use our API to call either the Retrieve Product API https://docs.stripe.com/api/products/retrieve or call the Retrieve Subscription API https://docs.stripe.com/api/subscriptions/retrieve and use our Expand feature https://stripe.com/docs/expand to also expand items.data.price.product to get the full Product object

slate pilot
#

Does the full price object have the original name in the data?
I couldn't fetch the original name of the product/price, nor see in the docs that the name will get returned.

clear raven
slate pilot
#

this solves my query, thanks a lot buddy @clear raven