We use cookies to make HubSpot's community a better place. Cookies help to provide a more personalized experience and relevant advertising for you, and web analytics for us. To learn more, and to see a full list of cookies we use, check out our Cookie Policy (baked goods not included).
Mar 8, 2021 10:33 AM
Trying to associate Products (line items) with Deals via the API and I'm not sure of the proper syntax to test the call within the HubSpot API documentation for Associations: https://developers.hubspot.com/docs/api/crm/associations.
I have the fromObjectId and the toObjectId, but the documentation doesn't really say what the proper syntax should be for Type, fromObjectType, and toObjectType.
I've tried product_to_deal and products_to_deals for Type and it's throwing errors specifically to the Type when I test the call in the documentation.
I'm using fromObjectType of Products and toObjectType of Deals and there doesn't seem to be any issues with that.
The Legacy API accomplished this Type using codes and laid out exactly which codes corresponded to what types of associations (https://legacydocs.hubspot.com/docs/methods/crm-associations/crm-associations-overview), but it doesn't look like the New API documentation does that.
Mar 8, 2021 3:06 PM
Hi @JChen1
Try "line_item_to_deal"
You can hit this endpoint (changing the objects in the request) to see the name
https://api.hubapi.com/crm/v3/associations/line_items/deals/types?hapikey=sswqsqioqq