#meteograms-subs-prices

1 messages · Page 1 of 1 (latest)

feral grove
#

I see that there is also subscription.items.data[i].price.id... should I be looking in there instead (all my subscriptions have only one price so I can just look in subscription.items.data[0].price.id I assume)
yes that is where you should look

taking a step back, just reference the price fields in the API

Prices are backward compatible with Plans, so the price: field will give you a Plan ID if you passed one there.

Plans won't immediately be deprecated but Prices are the newer abstraction so would recommend you move all your code to reference Prices

spice grotto
#

OK thanks. Related to this: what is subscription.plan.id (which I am currently using) when there might be more than one plan/price associated with the subscription? Just the first one [0]?

feral grove
#

I would refer to the items hash and look for the Price in there.

ooc can you link me to a Subscription object where you have the Plan top level on it? where you're referencing it as subscription.plan.id ?

spice grotto
#

How do I link you to the subscription?

feral grove
#

just send me the sub_123 Subscription ID

spice grotto
#

sub_1JaMxSHkIcPWRyQ1avYi0z8L

feral grove
#

gotcha thanks for sharing, so yeah going forward, just use the items hash and iterate through it (eventhough you only have the single Price) and not leverage subscription.plan as that isn't recommended going fowrard