# Create Deal in C#

**URL:** <https://community.hubspot.com/t/create-deal-in-c/12498>\
**Category:** APIs & Integrations\
**Tags:** object\
**Created:** [January 22, 2019, 6:27pm UTC](https://community.hubspot.com/t/create-deal-in-c/12498 "2019-01-22T18:27:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [January 22, 2019, 6:27pm UTC](https://community.hubspot.com/t/create-deal-in-c/12498/1 "2019-01-22T18:27:57Z")

</div>

Does anyone have an example on how to create a Deal in HubSpot using C#, RestSharp library?

---

<div class="post-metadata">

**Author:** ![IsaacTakushi](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/isaactakushi/32/70387_2.png) [@IsaacTakushi](https://community.hubspot.com/u/IsaacTakushi)\
**Post date:** [January 24, 2019, 5:10pm UTC](https://community.hubspot.com/t/create-deal-in-c/12498/2 "2019-01-24T17:10:51Z")

</div>

Welcome, [@wmamani](https://community.hubspot.com/u/wmamani).

What about something like this?

```auto
var client = new RestClient("https://api.hubapi.com/deals/v1/deal?hapikey=redacted");
var request = new RestRequest(Method.POST);
request.AddHeader("cache-control", "no-cache");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("undefined", "{\n \"associations\": {\n \"associatedCompanyIds\": [\n 263467842\n],\n \"associatedVids\": [\n 100001\n]\n },\n \"properties\": [\n {\n \"name\": \"dealname\",\n \"value\": \"C# Test Deal\"\n },\n {\n \"name\": \"dealstage\",\n \"value\": \"appointmentscheduled\"\n },\n {\n \"name\": \"pipeline\",\n \"value\": \"default\"\n },\n {\n \"name\": \"closedate\",\n \"value\": 1548349551000\n },\n {\n \"name\": \"amount\",\n \"value\": \"5000\"\n }\n]\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);

```

I’m not familiar with C#, but I generated that through Postman’s [code snippets](https://learning.getpostman.com/docs/postman/sending_api_requests/generate_code_snippets/) tool.

---

<div class="post-metadata">

**Author:** ![system](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/system/32/124_2.png) [@system](https://community.hubspot.com/u/system)\
**Post date:** [January 24, 2019, 6:01pm UTC](https://community.hubspot.com/t/create-deal-in-c/12498/3 "2019-01-24T18:01:40Z")

</div>

Thanks [@Isaac\_Takushi](https://community.hubspot.com/u/isaac_takushi)

---

<div class="post-metadata">

**Author:** ![AKansal9](https://avatars.discourse-cdn.com/v4/letter/a/eada6e/32.png) [@AKansal9](https://community.hubspot.com/u/AKansal9)\
**Post date:** [February 22, 2022, 4:52pm UTC](https://community.hubspot.com/t/create-deal-in-c/12498/4 "2022-02-22T16:52:27Z")

</div>

Hello,

Did you use any of the c# nugget libraries? I looked they are all missing DealHubSpotAssociations
