Hi, I'm trying to develop an integration from an e-commerce platform to HubSpot using HubSpot eCommerce bridge API. I use a unique ExternalObjectId for any object in sync messages. All fine but how can I get a synced object in HubSpot by its ExternalObjectId? There is no request endpoint which takes a parameter as ExternalObjectId and returns the corresponding object. My current problem is that I want to delete some line items from a deal but it can't be done by sync messages because as the document says "Please note: that the DELETE action type will not remove the object from HubSpot, it will prevent it from syncing in the future." I can't delete them by sync messages and also I don't have their object Id in HubSpot to delete them using the delete line item endpoint documented https://legacydocs.hubspot.com/docs/methods/line-items/delete-line-item. So, what can I do to delete some line items from a deal? Thanks in advance.
Yes there is no direct api to delete an object using ExternalObjectId for now.
But your requirement of deleting line item from deal can be achieved by using - get deal line items associations by using deal id and associations=line_items, In response you'll get line items details with line item id, you can filter out the line items you want to delete/update and perform the action usin line item id.
Thanks for the reply but as I mentioned before, I'm using HubSpot eCommerce bridge API and I only have the ExternalObjectId for any object. I don't have any information and idea about the object ids in HubSpot like deal Id for every deal. How can I access the deal Id for a deal when I sync orders to deals using HubSpot sync messages?
You can search the deal using the ExternalObjectId, i am supposing that if you are using the eComm bridge api you are creating deal for order or passing the ExternalObjectId in ip__ecomm_bridge__order_number.
using search api you can get the deal ID using the ExternalObjectId.