Retrieve associated line items with changed price

Hey,

I need to retrieve the associated line_items for a specific deal. I know this can be done by calling /crm/v3/objects/deals/{record_id}/associations/line_items
and then crm/v3/objects/line_item/{line_item_id}

However, if my colleagues will change the price of the item attached to the deal I will not know this by reading the general line_item from the product catalogue.
Does anyone know if the actual line_item attached including it’s potentially modified price / properties is somehow retrievable?

Hi @julevdl :waving_hand:

Have you tried using the “propertiesWithHistory” request parameter? This gives you visibility on property value changes over time. For example:

{
 "id": "123",
 "properties": {
 "amount": "15.000",
 "createdate": "2023-09-20T03:45:13.518Z",
 "hs_lastmodifieddate": "2023-09-20T03:48:54.276Z",
 "hs_object_id": "123",
 "hs_product_id": "987",
 "quantity": "1"
 },
 "propertiesWithHistory": {
 "price": [
 {
 "value": "15",
 "timestamp": "2023-09-20T03:48:54.276Z",
 "sourceType": "CRM_UI",
 "sourceId": "userId:13579",
 "updatedByUserId": 13579
 },
 {
 "value": "10",
 "timestamp": "2023-09-20T03:45:13.518Z",
 "sourceType": "CRM_UI",
 "sourceId": "userId:13579",
 "updatedByUserId": 13579
 }
 ]
 },
 "createdAt": "2023-09-20T03:45:13.518Z",
 "updatedAt": "2023-09-20T03:48:54.276Z",
 "archived": false
}

Where example Line Item ID is “123” and Line Item “Price” was changed from 10 to 15. This parameter can also be specified when interacting with the “List”

(within querystring)

and “Read a batch of”

(within request body)

{Object-type} API endpoints.

I hope this proves useful. Please let me know if you have any follow-up questions.