# Key Line items properties are not returned in custom code

**URL:** <https://community.hubspot.com/t/key-line-items-properties-are-not-returned-in-custom-code/119630>\
**Category:** APIs & Integrations\
**Created:** [October 31, 2024, 9:52pm UTC](https://community.hubspot.com/t/key-line-items-properties-are-not-returned-in-custom-code/119630 "2024-10-31T21:52:14Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ODeikun](https://avatars.discourse-cdn.com/v4/letter/o/ecccb3/32.png) [@ODeikun](https://community.hubspot.com/u/ODeikun)\
**Post date:** [October 31, 2024, 9:52pm UTC](https://community.hubspot.com/t/key-line-items-properties-are-not-returned-in-custom-code/119630/1 "2024-10-31T21:52:14Z")

</div>

Hello,

I am working with custom code and the Line Item API. I used the key and accessed Line Item properties, such as quantity, name, etc. However, no matter what I try, it doesn’t return any values. I have rewritten the code multiple times, but it consistently returns “undefined” for every property of the Line Item. I’m attaching screenshots of my latest attempt.

Currently, I am using a workaround, but I really need this feature to work as expected; otherwise, it will be nearly impossible to achieve the desired results.

Thank you.

 ![Знімок екрана 2024-10-31 213849.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/6/e/6e88992211a21600309050e3a3c4686b15d18255.png)

![Знімок екрана 2024-10-31 213837.png](https://d2qpr2jzcazej7.cloudfront.net/original/3X/4/1/418b10252b94cd7c7bdfc00e7347b9eec83d9113.png)

 ![Знімок екрана 2024-10-31 213549.png](https://d2qpr2jzcazej7.cloudfront.net/original/2X/e/e33aac4578503b8d670ea1b64d84a7f4477a1cb8.png)

---

<div class="post-metadata">

**Author:** ![SteveHTM](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/stevehtm/32/22074_2.png) [@SteveHTM](https://community.hubspot.com/u/SteveHTM)\
**Post date:** [November 1, 2024, 3:06pm UTC](https://community.hubspot.com/t/key-line-items-properties-are-not-returned-in-custom-code/119630/2 "2024-11-01T15:06:59Z")

</div>

@ODeikun - I’m having some difficulty understanding the code framents and other data you have posted here. But I believe that you may need to consider a change in strategy to get to the line item data.

Line items are not directly refreenced in the deal record, but are a set of records associated to the deal record. To obtain a list of thesse associations your initial custom cose would ned to call an assocations API call:

[https://api.hubapi.com/crm/v4/objects/{objectType}/{objectId}/associations/{toObjectType}](https://api.hubapi.com/crm/v4/objects/%7BobjectType%7D/%7BobjectId%7D/associations/%7BtoObjectType%7D)

This will give you a list of record IDs that you can use in your line item API calls.

Hope this helps!

Steve
