#hallmatt_api

1 messages ยท Page 1 of 1 (latest)

sullen kilnBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

hallow stump
#

Hello, the way to look at this in our API ref is to look at the entry for the object. Basically object fields are expandable in all API calls that work with the object so that is where we show what is expandable. In this case if you go to the Invoice object entry you can see the Expandable tag on certain properties like this:

golden trout
#

seems like line items arent expandable...specifically the product inside the line item

#

thats a bummer. thanks for the tip!

hallow stump
#

Expansion only goes four levels deep and I do see that that is five levels. Trying to think of what you can do here

sullen kilnBOT
golden trout
#

yeah...that might help

#

i essentially store some metadata on the product...that i need. ill try to figure something else out ๐Ÿ™‚

hallow stump
golden trout
#

I'm using one time purchases with invoices

#

With Checkout hosted pages.

#

I could copy over the metadata when I redirect...but if we end up using "add ons" or something like that, it might get weird

blazing atlas
#

Hi there, taking over for @hallow stump as they had to step away

#

Looking over the prior messages, it looks like your original approach was to retrieve an Invoice and expand lines.data.pricing.price_details.product, which is a valid approach but is more than 4 levels deep

#

@hallow stump suggested the list invoice items endpoint, which should enable you to expand the to the product

#

Do you think that approach would work for your use case?

golden trout
#

I am replicating data locally, so I'll try to figure something out. I might be able to expand it...but I'm listing quite a few invoices out and wanted to grab a bit more info. Most of our invoices will just have one line item that I need to grab data from (it's a credits based system...customers buy credits they can then use on the site)

sullen kilnBOT
blazing atlas
#

Got it. If there's a specific example that we can help with, just let us know!