#MarcusStripe

1 messages ยท Page 1 of 1 (latest)

lofty pumiceBOT
forest jolt
#

๐Ÿ‘‹ happy to help

#

actually you wouldn't be able to go that far

#

you have a limit of 4 expansion levels

#

so the best you can do is "data.items.data.price"

craggy folio
#

data.items.data.price woah confusing

#

is there any way to understand this whole confusing syntax?

#

I mean how could i come up with this myself???

#

so I guess instead of doing the expand, I could just retrieve the id of the price and then retrieve the priece object, expanded

distant lava
#

Hello ๐Ÿ‘‹
Stepping in as tarzan needs to step away

#

As my colleague mentioned, expand has a limit of 4 levels

I mean how could i come up with this myself???
You'd expand one level at a time to figure out what you want here

#

so I guess instead of doing the expand, I could just retrieve the id of the price and then retrieve the priece object, expanded
You could if you have the ID already

craggy folio
#

Price stripePrice = subscriptionItem.getPrice();

#

this returns the price object... how can I JUST retrive the price id instead?

#

because I woudl then just for the Id retrieve both price and product at once, instead

distant lava
#

The API won't return just the ID, it returns the whole object
So you might want something like subscriptionItem.getPrice().id (given getPrice() function works as expected)

craggy folio
#

even without the expand?

#

or do I need the expand, so that at a minimum I get the entire price object?

distant lava
#

It'd be easier to test it out to be honest.
Can you print out what subscriptionItem.getPrice() this gets you and share the object?

craggy folio
#

easier for you for sure.

#

not so easy here. working on it, anyway