Using the line items API for deals that have no quote_ID

How can I use the line items API to add line items to a deal that has not been quoted? My deals have a deal_ID but no quote_ID because we will not quote the deal until after we add line items by the API. (I get errors when trying to use the API without a quote_ID in the POST) Seems like a chicken and egg problem… I must be missing somthing.

Hey @Kevin_Jorgensen ,

thank you for reaching out. What you’re describing should work, and I’ve created processes in the past to create line times for a Deal.

What might be a bit unintuitive is the fact that after you created your Line Item through an API call with this endpoint

/crm/v3/objects/line_items

you need to associate it to a Deal with this other endpoint using the Line Item ID you get from the response:

/crm/v4/objects/line_items/{lineItemId}/associations/{toObjectType}/{toObjectId}

If you are creating multiple Line Items for a Deal, I recommend using the batch API endpoint and for looping over the response to associate everything to the Deal.

/crm/v3/objects/line_items/batch/create

Hope this helps. If not, please let us know what specific trouble you have, what your code does step by step and what error codes you receive.

If you found this post helpful, consider helping others in the community to find answers faster by marking this as a solution. I’d really appreciate it.

Cheers,

Chriso

The solution was very clear and completely solved the problem. Thank you!

Awesome! Happy to help.

Cheers, mate!