Posting Properties onto Custom Object Record (JS)

Hi @DEstillero

At a high level, you would want to create a Deal workflow, with whatever enrollment triggers you need.

Then, in your code, you would want to make 2 API calls:

The first API call would be to pull the line items associated with the deal enrolled in the workflow. You can pass in the Record ID for this, as a variable. You can use this page as your reference - specifically the endpoint for List. This will give you any line items. (If you don’t know how to reference {objectType}, see below)

You then want to store these results as variables for the next step.

For your second API call, you want to connect to the custom object endpoint - specifically the one in the Objects tab listed with Create. You will need the identifier for your custom object. You can find it in your portal by clicking the Contacts dropdown and selecting your custom object. The URL will look like this:

https://app.hubspot.com/contacts/\[portal number]/objects/[your custom object ID]/views/all/list

The part marked [your custom object ID] will be used where the API documentation asks for {objectType}. This is true for any other object you are trying to reference, such as Contacts or Deals. The Create endpoint allows you to add properties to the payload. This is where you want to use those variables with the line item data, to place them wherever you need.

I hope this was clear enough!

- Zach