Line Items in HubSpot are the individual product/service entries attached to Deals, Quotes, and (via integration) invoices. Like other HubSpot objects, Line Items support custom properties (fields) that can be created from the HubSpot UI under Settings > Properties > Line Item Properties.
However, there is one important limitation to be aware of when integrating Line Items with an external system : HubSpot's UI does not expose the option to mark a custom property as unique. If your integration needs a field that enforces uniqueness (for example, an external ID used as a matching/upsert key between HubSpot and an ERP), this can only be configured through the HubSpot API.
When syncing Line Items between HubSpot and an external system, you typically need a reliable external ID field to:
If this field isn't unique, HubSpot will allow multiple line items with the same external ID value, which breaks matching logic and can cause duplicate or orphaned records downstream.
Since the "unique value" property setting (hasUniqueValue) isn't available as a toggle in the property creation UI, the property must be created (or updated) via the CRM Properties API.
Endpoint:
POST https://api.hubapi.com/crm/v3/properties/line_itemsAuth: Bearer token (Private App token) or OAuth access token, passed as an Authorization: Bearer {token} header.
json
{
"name": "external_id",
"label": "External ID",
"type": "string",
"fieldType": "text",
"groupName": "lineitemattributes",
"description": "Unique external identifier used to match this line item with the source ERP/CRM system.",
"hasUniqueValue": true
}To confirm the property was created correctly, you can retrieve it with:
GET https://api.hubapi.com/crm/v3/properties/line_items/external_idThe response will include "hasUniqueValue": true if the setting was applied successfully.
Comment Editor X