PROPERTY_DOESNT_EXIST when trying to create product via API

Hi all. I’m trying to create a product in HubSpot via the API but I’m running into an error that I can’t make sense of. I’m using PHP and cURL and my payload for this test product is below:

{
	"properties":
	{
		"name": "8' Bar Foot Rail Kit - Polished Brass - 2 OD - Decorative Bar Rail Bracket + Domed End Cap",
		"price": "486.99",
		"hs_sku": "99000120",
		"ns_sku": "PB-8FT-DEC-DOMED-KIT",
		"description": "8' Bar Foot Rail Kit - Polished Brass - 2 OD - Decorative Bar Rail Bracket + Domed End Cap",
		"is_netsuite_product": "Y",
		"netsuite_product_id": "174733"
	}
}

And when I post it to /crm/v3/objects/contacts, I get the following error:

(
 [status] => error
 [message] => Property values were not valid: [{"isValid":false,"message":"Property \"description\" does not exist","error":"PROPERTY_DOESNT_EXIST","name":"description","localizedErrorMessage":"Property \"description\" does not exist","portalId":6632597},{"isValid":false,"message":"Property \"is_netsuite_product\" does not exist","error":"PROPERTY_DOESNT_EXIST","name":"is_netsuite_product","localizedErrorMessage":"Property \"is_netsuite_product\" does not exist","portalId":6632597},{"isValid":false,"message":"Property \"hs_sku\" does not exist","error":"PROPERTY_DOESNT_EXIST","name":"hs_sku","localizedErrorMessage":"Property \"hs_sku\" does not exist","portalId":6632597},{"isValid":false,"message":"Property \"ns_sku\" does not exist","error":"PROPERTY_DOESNT_EXIST","name":"ns_sku","localizedErrorMessage":"Property \"ns_sku\" does not exist","portalId":6632597},{"isValid":false,"message":"Property \"price\" does not exist","error":"PROPERTY_DOESNT_EXIST","name":"price","localizedErrorMessage":"Property \"price\" does not exist","portalId":6632597},{"isValid":false,"message":"Property \"name\" does not exist","error":"PROPERTY_DOESNT_EXIST","name":"name","localizedErrorMessage":"Property \"name\" does not exist","portalId":6632597},{"isValid":false,"message":"Property \"netsuite_product_id\" does not exist","error":"PROPERTY_DOESNT_EXIST","name":"netsuite_product_id","localizedErrorMessage":"Property \"netsuite_product_id\" does not exist","portalId":6632597}]
 [correlationId] => f9630436-8bc3-43b9-a05e-979429c3634e
 [category] => VALIDATION_ERROR
)

Thing is, these properties do exist. Take ‘hs_sku’ for example. This is a HubSpot field that exists normally:

But the response is telling me it doesn’t exist. Found another post with someone having this type of problem with adding a contact but he said that he solved it by correcting the name of the field in his code. I’ve double and triple checked them to make sure I have their names correct, even going so far as copying and pasting them from the HubSpot property editor. I’d appreciate a second set of eyes that may see what I’m missing.

Hi @JNichel,

I think the issue is that you are calling the wrong endpoint, you reference “/crm/v3/objects/contacts/” when infact it should be “/crm/v3/objects/products”.

For example see this request:

POST https://api.hubapi.com/crm/v3/objects/products
BODY 
{
 "properties": {
 "name": "8' Bar Foot Rail Kit - Polished Brass - 2 OD - Decorative Bar Rail Bracket + Domed End Cap",
 "price": "486.99",
 "hs_sku": "99000120",
 "ns_sku": "PB-8FT-DEC-DOMED-KIT",
 "description": "8' Bar Foot Rail Kit - Polished Brass - 2 OD - Decorative Bar Rail Bracket + Domed End Cap",
 "is_netsuite_product": "Y",
 "netsuite_product_id": "174733"
 }
}

RESPONSE CODE 201
BODY
{
 "id": "3895615460",
 "properties": {
 "createdate": "2024-08-22T09:31:58.733Z",
 "description": "8' Bar Foot Rail Kit - Polished Brass - 2 OD - Decorative Bar Rail Bracket + Domed End Cap",
 "hs_lastmodifieddate": "2024-08-22T09:31:58.733Z",
 "hs_object_id": "3895615460",
 "hs_object_source": "INTEGRATION",
 "hs_object_source_id": "3756289",
 "hs_object_source_label": "INTEGRATION",
 "hs_sku": "99000120",
 "is_netsuite_product": "Y",
 "name": "8' Bar Foot Rail Kit - Polished Brass - 2 OD - Decorative Bar Rail Bracket + Domed End Cap",
 "netsuite_product_id": "174733",
 "ns_sku": "PB-8FT-DEC-DOMED-KIT",
 "price": "486.99"
 },
 "createdAt": "2024-08-22T09:31:58.733Z",
 "updatedAt": "2024-08-22T09:31:58.733Z",
 "archived": false
}

and the Output in my HubSpot portal:

I’ve recorded a short video running through how I go about creating a product via the HubSpot API using this endpoint.

I hope this helps!

Jack

Jack,

Thank you for this. I’m a bit embarassed that I didn’t catch that. Tis what I get for copying code from one script to this one.

Hey @JNichel, no worries at all - happens the best of us! :joy: Glad you are sorted now anyways!