CRM

JTomas
Participante

API V3 Batch Create Deals is not working as expected (Associations)

I am trying to create a Deal using v3 API and according to documentation I could set up associations while creating a Deal.
In this case I would like to associate the deal to a Contact and a Company.

The body of the request looks like this

        {
          :body=> {
            :properties=> {
              :dealname=>"Anyname",
              :uuid=>"custom_property value",
              :amount=>"372.22",
              :createdate=>"2022-07-22",
              :closedate=>"2022-07-22",
              :dealstage=>"closedwon",
              :hs_priority=>"high"
             }, 
             :associations=>
              [
               {
                :to=>{ :id=>"101"}, 
                :types=>[{:associationCategory=>"USER_DEFINED", :associationTypeId=>9}]
               }
              ]
          }
        }

The API responds with 201 Created as expected. When checked in the dashboard I can see the Deal created but no associated contact for some reason.

I have tried creating it using the inversed association but that doesn't work either.
Not sure what could go wring here. The docs specify it like this.
Any help will be very much appreciatted.

0 Avaliação positiva
1 Resposta 1
JTomas
Participante

API V3 Batch Create Deals is not working as expected (Associations)

Update: I have played around this documentation page: https://developers.hubspot.com/docs/api/crm/deals , when using from the test client it works as expected.
Once it worked, I used the very same params for my request then, it didn't create the association.
The curious thing is the main object, the deal in this case, is created, only the associations are not.
Any help with this?

0 Avaliação positiva