Deals and Products Importing Natively and API Clarification
SOLVE
Hi,
Hoping to confirm some expected behavior with HS UI and also find a way to associate deals with products via the API
Testing importing products into HubSpot. Can you confirm you can only import (name, product description, product price, cost of goods sold) When doing the import it shows that you can map terms but the reality is it does not let you import terms it gives an error. It seems it's forcing you to manually add it which can't work for 100's of deals.Any reason why the UI is displaying this then in the import screen when it can't be imported
2)Looking to associate deals with products via an import. Not sure how to go about this. Was looking at this endpoint here(https://developers.hubspot.com/docs/methods/crm-associations/associate-objects) and was hoping you could provide more insight on the setup in postman. I see there was a conversation going on with this here(Get Products Associated with Deals via API) and was reading through but kinda stuck just testing a setting up a basic deal and product so I can try and scale this for multiple deals and products.Would you be able to provide an example of any deal and product association being sent to HubSpot via the associate crm object endpoint?
Deals and Products Importing Natively and API Clarification
SOLVE
Hey @karlon! Welcome and congrats on the new job! So this first part was tricky. Looks like the products import takes a very specific format for the Term property. Since it's available in the import screen to select from, we can definitely write to it. I found out the format by using a GET request to the CRM properties api to find the internal name of Term, then used it in another GET request to the GET all products endpoint. The way that the values in the Term property need to be formatted are as follows.
For monthly terms: P{number goes here}M
For yearly terms: P{number goes here}Y
For the second issue, there's actually a misconception here. You cannot actually associate Deals with Products. You must associate Deals with Line Items. Line items are instances of a product.
In order to do this, we'd make a PUT request to this endpoint:
Deals and Products Importing Natively and API Clarification
SOLVE
Hey @karlon! Welcome and congrats on the new job! So this first part was tricky. Looks like the products import takes a very specific format for the Term property. Since it's available in the import screen to select from, we can definitely write to it. I found out the format by using a GET request to the CRM properties api to find the internal name of Term, then used it in another GET request to the GET all products endpoint. The way that the values in the Term property need to be formatted are as follows.
For monthly terms: P{number goes here}M
For yearly terms: P{number goes here}Y
For the second issue, there's actually a misconception here. You cannot actually associate Deals with Products. You must associate Deals with Line Items. Line items are instances of a product.
In order to do this, we'd make a PUT request to this endpoint: