APIs & Integrations

wue
Participant

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

SOLVE

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?

1 Accepted solution
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

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

SOLVE

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. 

View solution in original post

5 Replies 5
Carly_Farlow
Contributor

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

SOLVE

Hi there! Curious what tool you are integrating with for the products tool?

 

We have found lots of limitations with moving forward with the products tool and would love to find a way to export all that is needed to get all products' feature into another tool that will allow us to view in an aggregated way.

0 Upvotes
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

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

SOLVE

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. 

Kapil
Participant

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

SOLVE

Thanks.

0 Upvotes
wue
Participant

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

SOLVE

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

0 Upvotes
WendyGoh
HubSpot Employee
HubSpot Employee

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

SOLVE

Hi @wue,

 

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

/properties/v2/line_items/properties

 

 

0 Upvotes