hubspot-net/HubSpot.NET

How to add contact to deal?

Closed this issue · 2 comments

How to add contact to deal?
when i create deal i cant add contacts Because "Associations" in "DealHubSpotModel" is read only, so i cant set contacts.

so... how i can add contact to new deal?

I solved it!

    var test = new DealHubSpotModel()
    {
        Amount = 10000,
        Name = "New Deal #1",
        Stage = "closedwon",
    };

    test.Associations.AssociatedContacts = new[] { contact.Id.Value };
    DealHubSpotModel deal = CreateApi().Deal.Create(test);
    return deal;

Great! @aramhai I'm glad you were able to resolve your issue! Thanks for using HubSpot.NET