LineitemAssociations
Returns object IDs associated with specific line items in HubSpot, supporting deal line item relationships.
Table-Specific Information
SELECT
The LineitemAssociations table always includes the same set of columns, but some return NULL unless you filter by Id and Type, which allows the driver to retrieve full association details.
To return full details for Line Item associations, filter by both the Line Item Id and the association Type.
The Type identifies the associated object (such as a Deal, Company, Contact, or Ticket).
-- Retrieve all fields for associations between a specific Line Item and its related Deals
SELECT *
FROM LineItemAssociations
WHERE Id = '436648510605' -- LineItem Id
AND Type = 'Deal'; -- Associated object type
Note: Fetching all fields can cause a reduction in performance, as it requires the driver to make requests for each LineItem.
Filtering by multiple Line Item Id values with IN, combined with the association Type, retrieves associations for up to 1,000 Line Items in a single batched request instead of one request per Line Item. The driver splits IN lists larger than 1,000 values into additional batched requests automatically.
-- Retrieve associations for multiple Line Items in a single batched request
SELECT *
FROM LineItemAssociations
WHERE Id IN ('436648510605', '436648510606', '436648510607')
AND Type = 'Deal';
DELETE
To remove a Line Item association, include both the Line Item Id and the association Type:
-- Delete a LineItem-Deal association
DELETE FROM LineItemAssociations
WHERE Id = '436648510605' -- LineItem Id
AND Type = 'Deal'; -- Associated object type
Columns
| Name | Type | ReadOnly | References | Filterable | Description |
| Id [KEY] | Long | False |
Lineitems.Id | False |
Unique identifier of the LineItem record. |
| AssociationId [KEY] | Long | False | False |
Unique identifier of the object associated with this LineItem. | |
| Type [KEY] | String | False | False |
The type of the associated object, such as a contact, deal, or ticket. | |
| TypeId [KEY] | String | False |
AssociationsLabels.TypeId | False |
Numeric ID representing the specific association type. This field is empty for general association queries. |
| Category [KEY] | String | False |
AssociationsLabels.Category | False |
The category of the association type for the object pair. This field is empty for general association queries. |
| TypeLabel | String | True |
AssociationsLabels.Label | False |
The descriptive label assigned to the association type between objects. |