Unable to create webhook due to missing required scope

I have been trying to create some webhooks in my squareup application but I have been getting

  "errors": [
      "category": "AUTHENTICATION_ERROR",
      "code": "INSUFFICIENT_SCOPES",
      "detail": "The merchant has not given your application sufficient permissions to do that. The merchant must authorize your application for the following scopes: DEVELOPER_APPLICATION_WEBHOOKS_WRITE"

I tried to add DEVELOPER_APPLICATION_WEBHOOKS_WRITE to my requested scopes but that does not work. How should I get the required scope?

That endpoint can only be used with your access token. It won’t work with OAuth tokens. This is cause webhooks subscriptions are on a per application scope not at a per OAuth token level. :slightly_smiling_face:

Thank you for the response.

Then do I need to ask each user to provide their personal access token from their account to create the webhooks I need for their account?

I need the webhooks to provide me with new orders placed on any account that has registered with my application. I would assume I have to create webhooks per account to get this information. So I think I will need each of theirs personal access tokens.

Webhook subscriptions are scoped at the application level. Not each individual OAuth’d seller. Once you create the webhooks subscription in the application you’ll automatically get the webhooks for all the OAuth’d sellers.

This endpoint is meant to be used with your access token if you’d like to add or remove any events you want the application to be subscribed to. :slightly_smiling_face: