#sayori_api

1 messages ¡ Page 1 of 1 (latest)

torn sequoiaBOT
#

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

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

opaque scarab
#

plan is the legacy integration and shouldn't be used. That's why the information is unavailable in the API doc page. Could you share what you would like to achieve?

river bramble
#

I see - looks like Subscription.items.data[0].price has nearly the same functionality (and more). is that what I should be using to determine a given subscription's product set?

opaque scarab
#

price is the new model for subscription that replaces the plan. So yes - Subscription.items.data[0].price should be the field to look at

river bramble
#

We're moving to a system where we could potentially have different levels of subscriptions, so I imagine I would be using the product (product_id?) to distinguish whether a user subscribed to one plan or to another plan. So I imagine I would use the Subscription.items.data[0].price.product field for that.

but since data could be a list, there are potentially multiple price objects - is there documentation describing how this could happen?

#

we've so far just been grabbing the 0th item by default, but I wonder whether we're leaving some undefined behvaior on the table here

opaque scarab
#

So I imagine I would use the Subscription.items.data[0].price.product field for that.
Yes, that's right!

but since data could be a list, there are potentially multiple price objects - is there documentation describing how this could happen?
It's possible to create a subscription with multiple items using prices. For example, a customer can subscribe to service A at price_A and service B at price_B in the same subscription. That's why the data can be a list.

river bramble
#

sweet, thanks for the help!