APIs & Integrations

anishghimire
Member

See custom properties values in Line Item within a Deal

SOLVE

We are creating custom properties for Products and Line Items using the APIs POST /properties/v2/products/properties and POST /properties/v2/line_items/properties. 

We are then able to add line items with all these properties populated to a Deal. However, I cannot find a way to look at these properties from the available APIs that I know for line items.

 

I have the line-item id as well as line item external Object Id in hand but these do not provide me the other custom properties for the line item. 

I used the following endpoints:

 

GET /crm-objects/v1/objects/line_items/:id

GET /crm-objects/v1/objects/line_items/paged

POST /crm-objects/v1/objects/line_items/batch-read

 

Sample Response for a line item from all these endpoints:

{
"objectType": "LINE_ITEM",
"portalId": 1111111,
"objectId": 174530606,
"properties": {
"hs_product_id": {
"versions": [{
"name": "hs_product_id",
"value": "33502409",
"timestamp": 1563463948731,
"source": "API",
"sourceVid": [],
"requestId": "f4378e36-8ca8-4c0d-b697-b1e2bcf86a5f"
}],
"value": "33502409",
"timestamp": 1563463948731,
"source": "API",
"sourceId": null
}
},
"isDeleted": false
}
 
Why are the custom properties that we have created for the product/line-item not visible in the response? The only property in the response is hs_product_id. 
Is there any other API from which I will be able to view other custom properties that I have created?
 
From the HubSpot UI I am able to view these custom properties from Contacts > List and then create a list based on these custom properties to filter the contacts but I am not able to look at them. Please suggest a way via UI/API to look at the line item properties.
0 Upvotes
1 Accepted solution
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

See custom properties values in Line Item within a Deal

SOLVE

Hi @anishghimire,

 

I hope all is well with you 🙂

 

When looking at this endpoint: Get a line item by ID and Get all line items; it is stated under second table, second rows (Line items properties):

"By default, only the ID, a few other system fields, and the hs_product_id are returned for the line items. You can include other line item properties in the response by requesting them in the URL. This parameter can be included multiple times to request multiple properties. See the example for more details."

 

This explains why you're only seeing the hs_product_id. In order to view the other properties, you can use &properties={{the internal value of the line item propety}}, in the request URL.

 

Hope this helps to clarify!

View solution in original post

1 Reply 1
WendyGoh
Solution
HubSpot Employee
HubSpot Employee

See custom properties values in Line Item within a Deal

SOLVE

Hi @anishghimire,

 

I hope all is well with you 🙂

 

When looking at this endpoint: Get a line item by ID and Get all line items; it is stated under second table, second rows (Line items properties):

"By default, only the ID, a few other system fields, and the hs_product_id are returned for the line items. You can include other line item properties in the response by requesting them in the URL. This parameter can be included multiple times to request multiple properties. See the example for more details."

 

This explains why you're only seeing the hs_product_id. In order to view the other properties, you can use &properties={{the internal value of the line item propety}}, in the request URL.

 

Hope this helps to clarify!