Access Webhooks (/hooks) from On-Terminal apps

Hi,

Is there a way to list / register WebHooks for current business from an On-Terminal app ?

Calling “/hooks” with the token retrieved from the device fails with below error

“Status: 401, Request merchant authorization by sending them to AuthURL”

Should we really need to launch a webpage asking user to authorize web hooks or is there a Poynt Permission that we can add to the manifest to overcome this ?

Thanks for the help
Srini

Srini,

The token on the device is issued to the device, not your applicationId. You need to create a self-signed JWT with your appId’s private key, and set the the subject claim to your appId (please make sure you are not doing it in your app since you don’t want to bundle your private key with in). If your app is installed on the terminal and the appId has the webhook permission you should be able to register webhook for that merchant account without doing oauth flow.

Hi Dennis,

Thanks for the reply.

  • Yes, we are generating a self-signed JWT on our server using the Terminal App’s “App ID” & “Private Key” and using that to calls “/hooks”

  • This terminal app already has permission for “Cloud Messages” (screenshot attached)

  • But we still get “401” when we try to call “/hooks”. Here is the request ID ( caf96cc2-6b04-4e9d-8f67-7d92e6be44c2 )

Is there anything else that needs to be done ?

Thanks
Srini

@dennis, any thoughts on the above issue ?