Retrieve Line items

Hi community,

I am new to the HubSpot API and am looking for some help. I am trying to delete certain line items that I created that were incorrect but first I need to find them.

If I wanted to use the API to pull all the line items that were created between a certain time frame how would I do that?

Thanks!

Hey, @MStevens11 :waving_hand: Have you looked into the Search API? Specifically, using the search operator `BETWEEN` in your request? It should be pretty easy to set this up as a test in Postman. If you need an example of how to structure your request body, please let me know and I’ll add one here.

Talk soon! — Jaycee

Hi Jaycee,

Thanks, I was able to get it structured correctly. I have another question which I posted which maybe you can help me with here.

Essentially, I made an incorrect upload of line items and I am looking to delete them from the database. I deleted the deals they were associated with and then reuploaded those deals with correct line items.

I am under the impression that deleting the deals did not delete the line items completely and they are floating around unattached to any deal, but when I ran my search against line items of a certain name over the past two days creation I got a list that matched those on my second import.

Do line items completely delete if their associated deal is deleted?

Hi Max,

In our experience, yes your line items will have been deleted.

“Pseudo” or “Secondary” objects that are subsets of and require association to a deal or quote (such as line items, fees and taxes) are deleted when the deal or quote is deleted.

In some cases we have detected that deletion was not immediate, but we suspect HubSpot has cleanup processes that work quickly to remove these pseudo-objects.

best

Pete