JDBC Driver for HubSpot

Build 26.0.9770

OrderAssociations

Returns object IDs associated with specific order records, enabling order association tracking.

Table-Specific Information

SELECT

The OrderAssociations 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 Order associations, filter by both the Order 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 Order and its related Deals
SELECT *
FROM OrderAssociations
WHERE Id = '436648510605'   -- Order 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 Order.

Filtering by multiple Order Id values with IN, combined with the association Type, retrieves associations for up to 1,000 Orders in a single batched request instead of one request per Order. The driver splits IN lists larger than 1,000 values into additional batched requests automatically.

-- Retrieve associations for multiple Orders in a single batched request
SELECT *
FROM OrderAssociations
WHERE Id IN ('436648510605', '436648510606', '436648510607')
  AND Type = 'Deal';

DELETE

To remove an Order association, include both the Order Id and the association Type:

-- Delete an Order-Deal association
DELETE FROM OrderAssociations
WHERE Id = '436648510605'   -- Order Id
  AND Type = 'Deal';        -- Associated object type

Columns

Name Type ReadOnly References Filterable Description
Id [KEY] Long False

Orders.Id

False

Unique identifier of the order record.

AssociationId [KEY] Long False False

Identifier of the object associated with this order, such as a contact or deal.

Type [KEY] String False False

Type of the associated object, such as contact, deal, or ticket.

TypeId [KEY] String False

AssociationsLabels.TypeId

False

Numeric ID representing the specific association type between the order and the associated object. Empty for generic association queries.

Category [KEY] String False

AssociationsLabels.Category

False

Category describing the association relationship between the order and the associated object. Empty for generic association queries.

TypeLabel String True

AssociationsLabels.Label

False

Label name representing the association relationship between the order and the associated object.

Copyright (c) 2026 CData Software, Inc. - All rights reserved.
Build 26.0.9770