APIs & Integrations

testuser27
Participante

API for accessing line item editor data

resolver

Hello,
I had one custom integraiton in which i need to associate product with deal and that is done by associating product with line item and that line item with deal but as of now i need to update quantity for line item that is associated with deal. So manually we can do this using line item editor of hubspot but i want to do this using api. I don't want to update main line item but want to update only line item that is associated with particular deal.
If anyone have ideal regarding this please help me as fast as possible.

Thanks in advance

0 Me gusta
1 Soluciones aceptada
quentin_lamamy
Solución
Asesor destacado | Partner nivel Diamond
Asesor destacado | Partner nivel Diamond

API for accessing line item editor data

resolver

I don't know how work the product part of hs, but it should work like the other object. You should make a request to get all association of a deal, and update the line item associated to it

GET /crm/v3/objects/deals/{dealId}/associations/{toObjectType}

Loop on item and then update it with

PATCH /crm/v3/objects/line_items/{lineItemId}

 

hsSign_smaller.png


Ver la solución en mensaje original publicado

0 Me gusta
7 Respuestas 7
CSilva6
Participante

API for accessing line item editor data

resolver

Solução explicada para esse exemplo:

https://api.hubapi.com/crm/v3/objects/dealsDEALIDHERE?hapikey=APIKEYHERE&associations=line_items

Com essa chamada você consegue pegar um "deal" específico os "line_items" associados, caso tenha. Se tiver, você vai encontrar uma estrutura de id e type relacionado a line_items. O que interessa, é o id. Com esse ID você pode usar a seguinte url:

https://api.hubapi.com/crm/v3/objects/line_items{lineItemId}?hapikey=APIKEYHERE

Substituindo o valor {lineItemId} pelo ID da consulta anterior, essa url vai retornar as informações do line_item específico.


4964e667-7f31-4730-872d-e4266ca89f02.jfif3c062c79-a2b1-444f-807a-b35b9bc62093.jfif

0 Me gusta
quentin_lamamy
Solución
Asesor destacado | Partner nivel Diamond
Asesor destacado | Partner nivel Diamond

API for accessing line item editor data

resolver

I don't know how work the product part of hs, but it should work like the other object. You should make a request to get all association of a deal, and update the line item associated to it

GET /crm/v3/objects/deals/{dealId}/associations/{toObjectType}

Loop on item and then update it with

PATCH /crm/v3/objects/line_items/{lineItemId}

 

hsSign_smaller.png


0 Me gusta
testuser27
Participante

API for accessing line item editor data

resolver

 

 

PATCH /crm/v3/objects/line_items/{lineItemId}

 

 

Can you please provide me json for this i'm getting inavlid json error. Below is my json

 

 

 

[
  {
    "name": "description",
    "value": "An updated description for this line item. Updating the quantity."
  },
  {
    "name": "quantity",
    "value": "5"
  }
]

 

 

Can you please suggest me changes if i forget anything that's needed to pass in JSON

0 Me gusta
dennisedson
Equipo de producto de HubSpot
Equipo de producto de HubSpot

API for accessing line item editor data

resolver

Hey @testuser27 ,

the json should look like this

{
  "properties": {
    "description": "An updated description for this line item. Updating the quantity.",
    "quantity": "5"
  }
}

 

0 Me gusta
quentin_lamamy
Asesor destacado | Partner nivel Diamond
Asesor destacado | Partner nivel Diamond

API for accessing line item editor data

resolver

Thanks @dennisedson for tag

 

Hi @testuser27 Not sure to right understand , what are line item, which object do you want to link and with which one ?

hsSign_smaller.png


0 Me gusta
testuser27
Participante

API for accessing line item editor data

resolver

Hello @quentin_lamamy ,
We want to link product to deal. for this we created line item from product and that line item we have associated with deal which working fine but we want update quantity of line item which is associated with deal.
Single line item could be associated with multiple deal and line items quantity would be very for each deal
So can you please help me that how I can update associated line items quantity for particular deal.

0 Me gusta
dennisedson
Equipo de producto de HubSpot
Equipo de producto de HubSpot

API for accessing line item editor data

resolver

Hello @testuser27 

Going to tag in a few people here to help!

@kjphilips , @quentin_lamamy could you all provide some advice here?

 

0 Me gusta