Hello !
I was prove to do an association between a deal and a contact after creating the deal. But the response is : Unable to infer object type from: userId…
I don’t understand what is wrong on my code… Maybe somebody have best eyes :
thank you !
const theMerchant = await this.userService.findOne({ where: { id: merchantId } })
const createDeals = await this.hubspotService.getService().crm.deals.basicApi.create({
properties: {
amount: `${event.amount / 100}`,
dealname: event.description,
dealstage: "presentationscheduled",
pipeline: "default",
nom_vendeur: `${theMerchant.firstname} ${theMerchant.lastname}`,
nom_acheteur: `${user.firstname} ${user.lastname}`,
type_de_livraison: 'transporter',
dealtype: 'sale',
etat: "0",
},
})
await this.hubspotService.getService().crm.deals.associationsApi.create(createDeals.id, theMerchant.hubspotUserId, "USER_DEFINED", "3")