I'm working on the integration of Hubspot API. I want to link a Deal with some Products through the API, but the API doc does not tell me much about it.
The "line_item_to_deal" segment of the URL tells Hubspot how to associate the two objects. You can use this format for associating most objects. eg. Associating a deal to a contact uses this endpoint URL: https://api.hubapi.com/crm/v3/objects/deals/{{deal ID}}/associations/contact/{{contactID}}/deal_to_contact
Unfortunately there isn't a way to create a line item and associate it with a deal in one step, like there used to be in the old API. Now it's necessary to use object association methods, or the associations API.
The "line_item_to_deal" segment of the URL tells Hubspot how to associate the two objects. You can use this format for associating most objects. eg. Associating a deal to a contact uses this endpoint URL: https://api.hubapi.com/crm/v3/objects/deals/{{deal ID}}/associations/contact/{{contactID}}/deal_to_contact
Unfortunately there isn't a way to create a line item and associate it with a deal in one step, like there used to be in the old API. Now it's necessary to use object association methods, or the associations API.
I understand the concept, but it does not make sense when I look at the existing endpoints in API v3. I find no endpoint to "create" a line item directly. And I don't understand which association to use to link a product to a deal (my initial question, GET https://api.hubapi.com/crm/v3/objects/associations/product/deal/types?hapikey=xxxx returns empty results, what association key should I use when I associate a product and a deal ?)