Create deals by API


#1

Hi, when send info to create deal by API, return null, without any errors.


#2

Hi @lugzweb,

Creating a deal using the Create a Deal endpoint should return a 200 response code and the deal details. Can you give me some info on the request you’re making and the response you’re seeing?


#3

I send to endpoint
"https://api.hubapi.com/deals/v1/deal/$id?hapikey=$key"

params are json string
{
“associations”: {
“associatedVids”: [
33333
]
},
“properties”: [
{
“value”: “Test name”,
“name”: “dealname”
},
{
“value”: “qualifiedtobuy”,
“name”: “dealstage”
},
{
“value”: “default”,
“name”: “pipeline”
},
{
“value”: “24”,
“name”: “hubspot_owner_id”
}
]
}

and response is null


#4

Hi @lugzweb,

That endpoint is intended for pulling a deal record (GET) or updating an existing deal record (PUT). If you’re looking to create a new deal record, you should send a POST request to: https://api.hubapi.com/deals/v1/deal/:id


#5

I send POST request by curl to this endpoint https://api.hubapi.com/deals/v1/deal?hapikey=key, but also result is null without any errors, maybe problem is in account settings?


#6

Hi @lugzweb,

Can you send your headers? Are you setting Content Type: application/json? Deals also requires access to the CRM; does the portal you’re trying to create a deal in have access to the CRM?