How can I retrieve the product association with a deal through API?

SOLVE
Highlighted
wue
New Contributor

I have a deal created with the selected product associated to the deal. Can I get the product association with the deal through the API?

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Community Manager

Hi @wue,

 

I hope all is well with you 😄

 

When looking to get the product association with the deal API, you can do so by going through the following steps:

1. Use this endpoint: Get associations for CRM object to get the deals and line items association (Line item contains the product details as it represent a line in an order).

Note: The definition ID here is 19 - https://developers.hubspot.com/docs/methods/crm-associations/crm-associations-overview (Deal to line item)

2. Once we retrieve the line items id, we can use this endpoint: Get line item by ID to get the product id, name, quantity and price. 

Reply
0 Upvotes
4 Replies 4
Community Manager

Hi @wue,

 

I hope all is well with you 😄

 

When looking to get the product association with the deal API, you can do so by going through the following steps:

1. Use this endpoint: Get associations for CRM object to get the deals and line items association (Line item contains the product details as it represent a line in an order).

Note: The definition ID here is 19 - https://developers.hubspot.com/docs/methods/crm-associations/crm-associations-overview (Deal to line item)

2. Once we retrieve the line items id, we can use this endpoint: Get line item by ID to get the product id, name, quantity and price. 

Reply
0 Upvotes
wue
New Contributor

Thanks, Wendy. That works great. 

Do you have a list of Line Items properties?I followed the examples on the page and get the property value of name, price and quantity, but would like to have te full list of properties as reference. 

 https://developers.hubspot.com/docs/methods/line-items/get_line_item_by_id

 

Thanks,

Emma

Reply
0 Upvotes
Community Manager

Hi @wue,

 

You can get all the line items properties by using this endpoint here: Get all object properties -- 

/properties/v2/line_items/properties

 

 

Reply
0 Upvotes
Occasional Contributor

Thanks.

Reply
0 Upvotes