APIs & Integrations

testuser27
参加者

API for accessing line item editor data

解決

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 いいね!
1件の承認済みベストアンサー
quentin_lamamy
解決策
キーアドバイザー | Diamond Partner
キーアドバイザー | Diamond Partner

API for accessing line item editor data

解決

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 いいね!
7件の返信
CSilva6
参加者

API for accessing line item editor data

解決

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 いいね!
quentin_lamamy
解決策
キーアドバイザー | Diamond Partner
キーアドバイザー | Diamond Partner

API for accessing line item editor data

解決

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 いいね!
testuser27
参加者

API for accessing line item editor data

解決

 

 

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 いいね!
dennisedson
HubSpot製品開発チーム
HubSpot製品開発チーム

API for accessing line item editor data

解決

Hey @testuser27 ,

the json should look like this

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

 

0 いいね!
quentin_lamamy
キーアドバイザー | Diamond Partner
キーアドバイザー | Diamond Partner

API for accessing line item editor data

解決

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 いいね!
testuser27
参加者

API for accessing line item editor data

解決

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 いいね!
dennisedson
HubSpot製品開発チーム
HubSpot製品開発チーム

API for accessing line item editor data

解決

Hello @testuser27 

Going to tag in a few people here to help!

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

 

0 いいね!