# Cannot retrieve line items from a deal using HubSpot API – endpoints return empty or error

**URL:** <https://community.hubspot.com/t/cannot-retrieve-line-items-from-a-deal-using-hubspot-api-endpoints-return-empty-or-error/137390>\
**Category:** APIs & Integrations\
**Tags:** timeline-and-extensions-apis\
**Created:** [August 4, 2025, 10:04am UTC](https://community.hubspot.com/t/cannot-retrieve-line-items-from-a-deal-using-hubspot-api-endpoints-return-empty-or-error/137390 "2025-08-04T10:04:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![oddleon](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@oddleon](https://community.hubspot.com/u/oddleon)\
**Post date:** [August 4, 2025, 10:04am UTC](https://community.hubspot.com/t/cannot-retrieve-line-items-from-a-deal-using-hubspot-api-endpoints-return-empty-or-error/137390/1 "2025-08-04T10:04:16Z")

</div>

Hi all,

I’m attempting to retrieve line items associated with a deal using a Custom Code Action in a HubSpot Workflow. I’m using a Private App with full CRM read access. Authentication works, and I can fetch general deal information, but I’m consistently unable to retrieve associated line items—even though they’re clearly visible in the HubSpot UI.

**What is working:**

- I can retrieve deal information using /crm/v3/objects/deals/dealId.
- Authentication via Private App works with Bearer token.
- Deal records are new and contain line items added through the “Add Product” button.

**What is not working:**

1. GET /crm/v3/objects/deals/dealId/line\_items  
Returns: results:
2. GET /crm/v4/objects/deals/dealId/associations/line\_items/deal\_to\_line\_item  
Returns: 405 Method Not Allowed
3. GET /crm/v4/objects/deals/{dealId}/associations/line\_items  
Returns: 404 Not Found
4. Checked for associated quotes using /crm/v4/objects/deals/{dealId}/associations/quotes – no quotes found.
5. Tried adding archived=false in requests. No difference.
6. Removed all property filters to rule out filtering as a cause.

**Goal:**  
I simply need to access the names (or product values) of the line items associated with a deal using a supported method within a workflow-based custom code action. So far, no combination of endpoints is returning the expected line item data, and I would appreciate a working approach or confirmation if there are known limitations here.

If you need more context:

- The portal uses a private app with full object scopes
- Deals are created recently
- Line items are added from the product library
- No quotes are involved

Thanks in advance for any guidance.

---

<div class="post-metadata">

**Author:** ![Victor\_Becerra](https://avatars.discourse-cdn.com/v4/letter/v/87869e/32.png) [@Victor\_Becerra](https://community.hubspot.com/u/Victor_Becerra)\
**Post date:** [August 4, 2025, 4:58pm UTC](https://community.hubspot.com/t/cannot-retrieve-line-items-from-a-deal-using-hubspot-api-endpoints-return-empty-or-error/137390/2 "2025-08-04T16:58:43Z")

</div>

Hi @oddleon  
Thank you for reaching out to the Community!  
I’d like to invite some community members who are subject matter experts to join this conversation.  
[@sylvain\_tirreau](https://community.hubspot.com/t5/user/viewprofilepage/user-id/601366) @GRajput @HubDoPete - Would you be able to share any insights on this? Your expertise would be greatly appreciated.  
Best,  
Victor

---

<div class="post-metadata">

**Author:** ![GRajput](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/grajput/32/102020_2.png) [@GRajput](https://community.hubspot.com/u/GRajput)\
**Post date:** [August 5, 2025, 1:51pm UTC](https://community.hubspot.com/t/cannot-retrieve-line-items-from-a-deal-using-hubspot-api-endpoints-return-empty-or-error/137390/3 "2025-08-05T13:51:25Z")

</div>

Hi @oddleon

As you have already retrieved the associated line item IDs using the Deal Associations API, the next step is to store these IDs in an array. Once you have the list of line item IDs, you can use the line item API to fetch detailed information about each line item, such as name, price, quantity, and associated product data. Here is the link to the line-item doc -

> **[Accounts Dashboard | HubSpot](https://app.hubspot.com/myaccounts?next=developerdocs&redirect=%2Freference%2Fapi%2Fcrm%2Fobjects%2Fline-items)**

I hope this will help you out. Please mark it as **Solution Accepted and upvote** to help another Community member.

Thanks!
