Get line_item_id for a specific product

SOLVE
Highlighted
Occasional Contributor

I am trying to use the API to add a particular product to certain deals. Reading the documentation, I understand this must be done by an object association (definition 19 or 20) using the line_item_id -- however I can't for the life of me locate the line_item_id for this particular product!

 

I've tried to locate by listing all line items, however there are hundreds to filter through, and it doesn't seem to allow searching via product ID. 

 

Is there a simple way to get the appropriate hs_product_id's line_item_id? 

Reply
0 Upvotes
1 Accepted solution

Accepted Solutions
Highlighted
Regular Advisor | Gold Partner

Hii @purrlo 

 

Have you completed running creation of line items API in which we send HS Product Id? Additionally this is the process to do the above:

1. Create Product in HS library using Create a Product . Save the object ID returned from HubSpot at your end.
2. Create a deal and save the deal id at your end
3. Run line items api using Create Line Item . The hs_product_id here is the object id from 1st step. Save the line item object id returned in 202 response.
4. Run Associate CRM objects to associate line items and deals. Use 20 as definition ID to associate line item to deal.

Thanks

Digital Marketing & Inbound Expert In Growth Hacking Technology
2 Replies 2
Highlighted
Regular Advisor | Gold Partner

Hii @purrlo 

 

Have you completed running creation of line items API in which we send HS Product Id? Additionally this is the process to do the above:

1. Create Product in HS library using Create a Product . Save the object ID returned from HubSpot at your end.
2. Create a deal and save the deal id at your end
3. Run line items api using Create Line Item . The hs_product_id here is the object id from 1st step. Save the line item object id returned in 202 response.
4. Run Associate CRM objects to associate line items and deals. Use 20 as definition ID to associate line item to deal.

Thanks

Digital Marketing & Inbound Expert In Growth Hacking Technology
Highlighted
Occasional Contributor

The products and deals already exist, I just thought I could link the two - add product A) to existing deal.

 

I seem to have misunderstood how the line_item_id works - so I need to create a line item for the deal, and then associate the line item to the deal, for each deal instance?

Reply
0 Upvotes