APIs & Integrations

ODeikun
Member

Key Line items properties are not returned in custom code

SOLVE

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Знімок екрана 2024-10-31 213837.pngЗнімок екрана 2024-10-31 213549.png

0 Upvotes
1 Accepted solution
SteveHTM
Solution
Guide | Partner
Guide | Partner

Key Line items properties are not returned in custom code

SOLVE

@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}

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

 

Hope this helps!

 

Steve

Steve Christian

HTM Solutions

https://info.htmsolutions.biz/meetings/stevec2

mobilePhone
+1 6195183009
emailAddress
stevec@htmsolutions.biz
website
www.htmsolutions.biz
address
San Diego, CA
Create Your Own Free Signature

View solution in original post

0 Upvotes
1 Reply 1
SteveHTM
Solution
Guide | Partner
Guide | Partner

Key Line items properties are not returned in custom code

SOLVE

@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}

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

 

Hope this helps!

 

Steve

Steve Christian

HTM Solutions

https://info.htmsolutions.biz/meetings/stevec2

mobilePhone
+1 6195183009
emailAddress
stevec@htmsolutions.biz
website
www.htmsolutions.biz
address
San Diego, CA
Create Your Own Free Signature
0 Upvotes