Missing scope "e-commerce" when trying to create a product

Hi,

when trying to create a product via the HubSpot API (POST on https://api.hubapi.com/crm/v3/objects/products), I’m getting an error that the “e-commerce” scope would be missing:

{
 "status": "error",
 "message": "This app hasn't been granted all required scopes to make this call. Read more about required scopes here: https://developers.hubspot.com/scopes.",
 "correlationId": "10790ba4-5eeb-4f2c-8915-b7131e409938",
 "errors": [
 {
 "message": "One or more of the following scopes are required.",
 "context": {
 "requiredScopes": [
 "e-commerce"
 ]
 }
 }
 ],
 "links": {
 "scopes": "https://developers.hubspot.com/scopes"
 },
 "category": "MISSING_SCOPES"
}

I’ve tried it using the old API Key method, as well as using a private app with the scope in question added.

Other endpoints (e.g. searching, creating contacts) are working just fine. Am I missing something?

Best regards and thanks in advance!

Hi, @m3g4p0p :waving_hand: Please forgive the basic questions, and can you confirm the following:

  • Are you using a Private App? If not, can you create one and grant it only the ecommerce scope? And then try from the documentation page — Products API.

I have a Private App set up with only one scope and verified the endpoint works as expected when using one of my app test accounts.

Request:

curl --request POST \
 --url https://api.hubapi.com/crm/v3/objects/products \
 --header 'authorization: Bearer YOUR_ACCESS_TOKEN' \
 --header 'content-type: application/json' \
 --data '{
 "properties": {
 "description": "Onboarding service for cat motorcycle riders",
 "hs_cost_of_goods_sold": "6000.00",
 "hs_sku": "1234567",
 "name": "Implementation Service ",
 "price": "6000.00"
 }
}'

Response:

HTTP 201

{
 "id": "1659665537",
 "properties": {
 "createdate": "2022-11-15T18:02:30.520Z",
 "description": "Onboarding service for cat motorcycle riders",
 "hs_cost_of_goods_sold": "6000.00",
 "hs_lastmodifieddate": "2022-11-15T18:02:30.520Z",
 "hs_object_id": "1659665537",
 "hs_sku": "1234567",
 "name": "Implementation Service ",
 "price": "6000.00"
 },
 "createdAt": "2022-11-15T18:02:30.520Z",
 "updatedAt": "2022-11-15T18:02:30.520Z",
 "archived": false
}

Thanks for the additional information! — Jaycee

Hi @Jaycee_Lewis, thanks for your reply! :slightly_smiling_face:

Yes I’m using a private app (and, in fact, a test account where we are testing things before going production)… and the last time we were developing something a couple of weeks ago everything used to work.

I also created another private app with only the “e-commerce” scope added but still getting the same error. Maybe another thing to note: apparently there’s now a limit for custom properties, which I have exceeded (You’ve used 42 out of 10 custom properties.)… could this be an issue? Unfortunately I’m not able to archive these to check. ^^

Cheers!

Update: It worked with a new test account.

Hey, @m3g4p0p :waving_hand: Thanks for letting us know!