Deal–Line Item Association API Returns Success (200 OK) But No Association Appears in CRM

Hi Community,

I’m trying to associate a line item to a deal using the CRM v4 associations API.
The API responds with 200 OK (success) but the association is not created in the CRM.

:wrench: API Call Used

PUT https://api.hubapi.com/crm/v4/objects/deals/{dealId}/associations/line_items/{lineItemId}

Request body:

[ { “associationCategory”: “HUBSPOT_DEFINED”, “associationTypeId”: 20 } ]

:check_mark: What works

  • The request succeeds with 200 OK

  • No validation errors

  • Private App token has full CRM scope

    ✘ What doesn’t work

    • The line item is not visible under the deal

    • The deal is not visible under the line item

    • Association never appears, even after a few minutes

      :magnifying_glass_tilted_left: What I’ve checked

      • The dealId and lineItemId are valid

      • The line item and deal both exist

      • Testing via:

        • Custom Code Action

        • Postman

        • HubSpot API Test Console

        • Same result everywhere (success but no actual association)

                  ### 💡 **Note**
          
                  This issue started only recently — previously the same pattern worked.
          
                  ### ❓ **Questions**
          
          1. Is associationTypeId = 20 still valid for deal ↔ line_item?

          2. Has HubSpot changed association logic for line items (especially with the new Commerce updates)?

          3. Why would the API return success but not write the association?

                           Any help or confirmation would be appreciated.
            

Hi @GMaheshwari and Happy Friday!
Thank you for asking such great questions in the HubSpot Community!

Here are a few resources that might be helpful:
- CRM API | Line items
- CRM API | Associations v4
Also, I’d love to put you in touch with our Top Experts: Hi @Anton, @SteveHTM and @tmcginnis do you have suggestions to help @GMaheshwari, please?
Thanks so much and have a great weekend!
Bérangère

@GMaheshwari - can you confirm you have check the association of the line item before and after your call via the API (not just via the UI screen). I’m wondering if there is some issue with the set up of teh line item object. What created this line item?

Steve

@GMaheshwari - by the way, my reading of the documentaton suggest that the typeid is 19 for Deal-->Line item. But that should have thrown an error I woudl hve expected.

Steve

Hi @GMaheshwari , I’ve seen this happen lately with deals and line items, and a 200 OK with no visible association usually means HubSpot rejected the link silently because the pair doesn’t use the HUBSPOT_DEFINED type anymore.

With the Commerce updates, line items rely on the default “primary line items” association, and that one is created automatically when the line item is assigned to a deal through the standard PATCH on the line item’s hs_parent_deal_id rather than the generic associations endpoint. The association docs note this shift toward object-specific linkage rules instead of the old numeric IDs (Accounts Dashboard | HubSpot )

If you try updating the line item and set its parent deal directly, it should appear instantly on both sides. When the associationTypeId is wrong or deprecated, HubSpot still returns 200 as long as the body is valid, so nothing surfaces as an error. Are you generating these line items through an external system or rebuilding them manually? When product or pricing data lives outside HubSpot, Stacksync keeps deals and line items aligned so you don’t have to chase these association quirks.