CRM API v3 - Get Product by SKU or Search by SKU?

Hello Community,

I am building scripts to sync my company’s products over to HubSpot so we can use HubSpot’s native reporting tools with more depth. I am putting a foreign key reference to my company product id in the hubspot product definition and vice versa so I can cross reference ID values across the two systems. I would also like to keep the SKU value the same across both systems as it is a more user-friendly identifier. It seems that I can set the SKU value for each product in HubSpot, but cannot find a way to fetch a product by that same SKU value, even though it is treated as a unique, alternative key.

So far, I have only been able to fetch products by the native HubSpot product id. Has anyone found a way to fetch a product by its SKU or search through products using the SKU field? If not, are there plans to create this functionality in the future?

@danhammari ,

You should be able to search by properties when using the search endpoint.

https://api.hubapi.com/crm/v3/objects/products/search

Basic json body below:

{
 "filters": [
 {
 "value": "12345645",
 "propertyName": "hs_sku",
 "operator": "EQ"
 }
 ]
}

You can get much fancier than that. All should be in the docs :grinning_face:

Thanks for pointing out that I should be using field name “hs_sku” for the search propertyName. I was using “sku” and getting error messages. Thanks!

@danhammari , I did the same thing initially :sweat_smile:. You can always hit the properties endpoint to get the actual name. I live in there!