#Jgreensmith12
1 messages · Page 1 of 1 (latest)
Hi,
Yes you can't expand attributes from Webhook events.
You need to make an extra call and get the priceId
ok, thankyou i'll give that a try
Hi, sorry i'm not sure what call to make to access the priceId using the event data
and the listLineItems doesn't return a productid!
Hey, can you share the JSON response from the API request in the screenshot? I think that should work
Also, what it is exactly you want. You mentioned both a price and product ID (both should be there)
Is that from a console.log?
i need to access price.product because there's extra infomation
yes thats the console.log items
Yeah the issue is console.log only prints top level JSON, it doesn't also print any deeply nested hashes
(you can tell by the price: [Object] notation)
Try console.dir() instead
I suspect the data you want is there, you just can't see it because of console.log limitations
If you log the actual field as opposed to the full payload, do you get the value you expect? i.e. items.data[0].price.id
In other words, console.dir() is the way to see all the properties of a specified JavaScript object in console by which the developer can easily get the properties of the object.
https://developer.mozilla.org/en-US/docs/Web/API/console/dir