APIs & Integrations

tsousan
Member

HubSpot API Details

The Deal products are not accessible via the Deal API. A deal can be assigned multiple products but they do not seem to be visible via the API. The deal overall Product Type and Amount are visible but not the detailed products and amounts of a deal.

0 Upvotes
2 Replies 2
cbarley
HubSpot Alumni
HubSpot Alumni

HubSpot API Details

Hi @tsousan, Currently, the GET deals endpoints returns the total Deal amounts, not each individual Line Item (from your screenshot, those items are actually line items). In order to grab the info on each line item for a given deal, we'll need to use a combination of the CRM Associations API and the CRM Objects API

First, you should make a request to the Associations API using the deal ID you currently have. Using the associations definitions, you'll want to GET all associations of deals to line items, so we'd use definition 19 here. Your GET url would look something like this:

https://api.hubapi.com/crm-associations/v1/associations/12345/HUBSPOT_DEFINED/19?hapikey=(redacted)

You'll get an array of resulting line item ID's in this instance, where you can then use those in your request to this endpoint: https://developers.hubspot.com/docs/methods/line-items/get_line_item_by_id

Your GET url would look like this:

https://api.hubapi.com/crm-objects/v1/objects/line_items/123456789?hapikey=(redacted)

0 Upvotes
ivanarandaa7
Member

HubSpot API Details

Hello!
I'm having this same issue using the Hubspot's API v3. Do we still have to do the same?
Thanks!

0 Upvotes