Error When Posting Deals via API

This is my first HubSpot integration. I am working on a integration an ERP application with HubSpot for a client and am having some issues with uploading deals. Here is the error I get:

{“validationResults”:[{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”},{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”},{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”},{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”},{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”}],“status”:“error”,“message”:“Property values were not valid”,“correlationId”:“f2f9a04c-1e3d-4342-b3e4-319c9d96a689”,“requestId”:“4aee1cf82efebd317d92e594bd051f0f”}

Any feedback to get me moving would be much appreciated.

Welcome, @Aaron10XCG.

Happy to help. To troubleshoot effectively, though, I’ll need a bit more information. Would you share:

  1. Confirm whether your client account is 2495654.
  2. The full request URL you used, including the method.
  3. The raw request body, including the headers.

The error you shared suggests you are trying to pass values for properties which do not yet exist in the client account. I can cross-reference your payload with the properties in that account. If this is indeed the issue, you may first need to create those properties manually or via the Deal Properties API.

Thank you for replying,
I am uisng the online sample: https://developers.hubspot.com/docs/methods/deals/create_deal
Here is the raw conversation:
Request:

POST http://api.hubapi.com/deals/v1/deal?hapikey=demo HTTP/1.1
User-Agent: EssEtlProcess
Content-Type: application/json
Host: api.hubapi.com
Content-Length: 416
Expect: 100-continue
Connection: Keep-Alive

{“associations”:{“associatedCompanyIds”:[8954037],“associatedVids”:[27136]},“properties”:[{“property”:“dealname”,“value”:“Tim’s Newer Deal”},{“property”:“dealstage”,“value”:“appointmentscheduled”},{“property”:“pipeline”,“value”:“default”},{“property”:“hubspot_owner_id”,“value”:“24”},{“property”:“closedate”,“value”:1409443200000},{“property”:“amount”,“value”:“60000”},{“property”:“dealtype”,“value”:“newbusiness”}]}
Response:

HTTP/1.1 400 Bad Request
Date: Mon, 04 Feb 2019 13:56:17 GMT
Content-Type: application/json;charset=utf-8
Content-Length: 892
Connection: keep-alive
Set-Cookie: __cfduid=d7300a715b67238480a683ed576a3b3511549288577; expires=Tue, 04-Feb-20 13:56:17 GMT; path=/; domain=.hubapi.com; HttpOnly
X-Trace: 2B99B15F1C93BE77BCCA127EA919AB0DE957A83566000000000000000000
X-HubSpot-RateLimit-Daily: 40000
X-HubSpot-RateLimit-Daily-Remaining: 39998
X-HubSpot-RateLimit-Secondly: 10
X-HubSpot-RateLimit-Secondly-Remaining: 9
Access-Control-Allow-Credentials: false
Server: cloudflare
CF-RAY: 4a3da3cb789e8291-ATL

{“validationResults”:[{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”},{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”},{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”},{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”},{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”},{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”},{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”}],“status”:“error”,“message”:“Property values were not valid”,“correlationId”:“b93165d3-f2f9-44f0-82fa-d1f2ae76279e”,“requestId”:“0e1977b47d73c6fe347e2f5fbed801f8”}

Thank you for clarifying, @koseto.

The issue is that some of the property values you are trying to pass do not exist in the demo account. Any developer can access and manipulate the data in that account and, to be frank, many of the examples no longer work. As such, it’s no longer the best way to test HubSpot APIs.

Instead, I recommend creating a test account in your developer account and using the test account’s API key. That way, only you have access to the account and can customize the properties to fit your testing needs.

Apologies for the inconvenience. Please let me know if I can clarify further.

Account Number is 4071983. I have been able to upload files manually so I know the fields should be there, but perhaps there are some slight variations in the names we need to review.

Here is the sample “Create Deal” from the Hubspot dev documentation:

https://developers.hubspot.com/docs/methods/deals/create_deal

Request:

POST http://api.hubapi.com/deals/v1/deal?hapikey=demo HTTP/1.1

User-Agent: EssEtlProcess

Content-Type: application/json

Host: api.hubapi.com

Content-Length: 284

Expect: 100-continue

Connection: Keep-Alive

{“associations”:{“associatedCompanyIds”:[8954037],“associatedVids”:[27136]},“properties”:[{“property”:“dealname”,“value”:“Tim’s Newer Deal2”},{“property”:“dealstage”,“value”:“appointmentscheduled”},{“property”:“closedate”,“value”:1546267648544},{“property”:“amount”,“value”:“60000”}]}

Response:

HTTP/1.1 400 Bad Request

Date: Mon, 04 Feb 2019 16:35:00 GMT

Content-Type: application/json;charset=utf-8

Content-Length: 589

Connection: keep-alive

Set-Cookie: __cfduid=d98588cec38a915f7588e31f1d4d2ea421549298100; expires=Tue, 04-Feb-20 16:35:00 GMT; path=/; domain=.hubapi.com; HttpOnly

X-Trace: 2B12F68966FBC351C60940AAFFDC5AA4D55EFF1616000000000000000000

X-HubSpot-RateLimit-Daily: 160000

X-HubSpot-RateLimit-Daily-Remaining: 18049

X-HubSpot-RateLimit-Secondly: 60

X-HubSpot-RateLimit-Secondly-Remaining: 57

Access-Control-Allow-Credentials: false

Server: cloudflare

CF-RAY: 4a3e8c45db79b9ca-ATL

{“validationResults”:[{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”},{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”},{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”},{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”}],“status”:“error”,“message”:“Property values were not valid”,“correlationId”:“99fb1dc3-bf8d-4698-b0b1-ea873ef18cc9”,“requestId”:“35c1aa6f4e377de4b0f8acb89b6bc2de”}

The account number is 407183.

I am uisng the online sample: https://developers.hubspot.com/docs/methods/deals/create_deal
Here is the raw conversation:
Request:
POST http://api.hubapi.com/deals/v1/deal?hapikey=demo HTTP/1.1
User-Agent: EssEtlProcess
Content-Type: application/json
Host: api.hubapi.com
Content-Length: 416
Expect: 100-continue
Connection: Keep-Alive
{“associations”:{“associatedCompanyIds”:[8954037],“associatedVids”:[27136]},“properties”:[{“property”:“dealname”,“value”:“Tim’s Newer Deal”},{“property”:“dealstage”,“value”:“appointmentscheduled”},{“property”:“pipeline”,“value”:“default”},{“property”:“hubspot_owner_id”,“value”:“24”},{“property”:“closedate”,“value”:1409443200000},{“property”:“amount”,“value”:“60000”},{“property”:“dealtype”,“value”:“newbusiness”}]}
Response:
HTTP/1.1 400 Bad Request
Date: Mon, 04 Feb 2019 13:56:17 GMT
Content-Type: application/json;charset=utf-8
Content-Length: 892
Connection: keep-alive
Set-Cookie: __cfduid=d7300a715b67238480a683ed576a3b3511549288577; expires=Tue, 04-Feb-20 13:56:17 GMT; path=/; domain=.hubapi.com; HttpOnly
X-Trace: 2B99B15F1C93BE77BCCA127EA919AB0DE957A83566000000000000000000
X-HubSpot-RateLimit-Daily: 40000
X-HubSpot-RateLimit-Daily-Remaining: 39998
X-HubSpot-RateLimit-Secondly: 10
X-HubSpot-RateLimit-Secondly-Remaining: 9
Access-Control-Allow-Credentials: false
Server: cloudflare
CF-RAY: 4a3da3cb789e8291-ATL
{“validationResults”:[{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”},{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”},{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”},{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”},{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”},{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”},{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”}],“status”:“error”,“message”:"Property values were not

valid",“correlationId”:“b93165d3-f2f9-44f0-82fa-d1f2ae76279e”,“requestId”:“0e1977b47d73c6fe347e2f5fbed801f8”}

Hi, @Aaron10XCG.

Account 407183 was deactivated in 2014, so it’s not possible to use that account.

Furthermore, it’s the API key that matters, so if you are using hapikey=demo, then your calls are going to the demo account, which is different than 407183.

Sorry about that, missed a number. 4071983.

Thanks, @Aaron10XCG.

I was able to create this test deal with the following data:

{
 "associations": {
 "associatedCompanyIds": [],
 "associatedVids": []
 },
 "properties": [
 {
 "value": "Developer Support Test Deal",
 "name": "dealname"
 },
 {
 "value": "appointmentscheduled",
 "name": "dealstage"
 },
 {
 "value": "default",
 "name": "pipeline"
 },
 {
 "value": "123",
 "name": "amount"
 }
 ]
}

While the test data in our documentation is a great place to start, I generally don’t recommend pasting it directly into requests. Values for properties can differ widely between accounts and the example values often throw errors.

For example, account 4071983 does not have a newbusiness option for the dealtype property (seen here), so your request would fail for that reason alone.

The account number we are using is 4071983. Exact method and error is from koseto, who is also working on this project.

Here is the what we are trying:

POST http://api.hubapi.com/deals/v1/deal?hapikey=demo HTTP/1.1

User-Agent: EssEtlProcess

Content-Type: application/json

Host: api.hubapi.com

Content-Length: 284

Expect: 100-continue

Connection: Keep-Alive

{“associations”:{“associatedCompanyIds”:[8954037],“associatedVids”:[27136]},“properties”:[{“property”:“dealname”,“value”:“Tim’s Newer Deal2”},{“property”:“dealstage”,“value”:“appointmentscheduled”},{“property”:“closedate”,“value”:1546267648544},{“property”:“amount”,“value”:“60000”}]}

Response:

HTTP/1.1 400 Bad Request

Date: Mon, 04 Feb 2019 16:35:00 GMT

Content-Type: application/json;charset=utf-8

Content-Length: 589

Connection: keep-alive

Set-Cookie: __cfduid=d98588cec38a915f7588e31f1d4d2ea421549298100; expires=Tue, 04-Feb-20 16:35:00 GMT; path=/; domain=.hubapi.com; HttpOnly

X-Trace: 2B12F68966FBC351C60940AAFFDC5AA4D55EFF1616000000000000000000

X-HubSpot-RateLimit-Daily: 160000

X-HubSpot-RateLimit-Daily-Remaining: 18049

X-HubSpot-RateLimit-Secondly: 60

X-HubSpot-RateLimit-Secondly-Remaining: 57

Access-Control-Allow-Credentials: false

Server: cloudflare

CF-RAY: 4a3e8c45db79b9ca-ATL

{“validationResults”:[{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”},{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”},{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”},{“isValid”:false,“message”:“Property \”\" does not exist",“error”:“PROPERTY_DOESNT_EXIST”,“name”:“”}],“status”:“error”,“message”:“Property values were not valid”,“correlationId”:“99fb1dc3-bf8d-4698-b0b1-ea873ef18cc9”,“requestId”:“35c1aa6f4e377de4b0f8acb89b6bc2de”}

Hi, @Aaron10XCG and @koseto.

Sincere apologies for the delayed response.

To be transparent, I missed your reply. This is partially because I was not tagged in any of the posts. It’s really easy for these kinds of replies to fall through the cracks, so please tag me in future messages with @IsaacTakushi.

I’m not sure if you’re still unable to create deals, but I’m now seeing one issue that did not jump out to me before.

You are attempting to pass deal property values with the property and value fields when the Deals API only accepts name and value pairs. Even if your internal deal property names were correct, placing them in a property field would throw a 400 error.