question

zapier-devs avatar image
zapier-devs asked Frank Faustino Deactivated answered

Unauthorized 401 Every Request

Here is an example of a request we are attempting to hit: https://cdn.zapier.com/storage/files/9bf789819bd21f56451e6f1e4534d981.txt I'm having trouble getting anything to successfully authenticate. Following Clover's docs and using the sandbox env. Everything 401s even with a brand new access_token and a verified Merchant ID even in the "playground" in the docs: https://docs.clover.com/clover-platform/reference#merchants-1 using "Try It". I get unauthorized messages after receiving a new token. Curious if you have guidance on if I'm doing anything wrong.

Confirmed that I have a valid merchant ID and also a valid access_token retrieved via Oauth through the Sandbox endpoints
OAuthAuth
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Frank Faustino avatar image
Frank Faustino Deactivated answered
Hi, @zapier_devs!

Here are some troubleshooting steps to follow when experiencing a 401 error:
  • Base URL/environment is correct in API endpoint
  • Merchant ID is correct in API endpoint
  • App Secret used to fetch token in OAuth endpoint is correct
  • App ID used to fetch token in OAuth endpoint is correct
  • App is installed on the merchant
  • Required permissions are enabled in the app
  • API token is valid & has required permissions
    • Make sure the token has not been expired.
    • Make sure the token, which is being used in your app, was fetched by said app
    • Tokens obtained through OAuth have only the Permissions which were enabled at the time the Merchant installed the app. Any permissions enabled after installation will not go into effect until the Merchant uninstalls and then reinstalls the app. Subsequent tokens will have the newly added permission.
Additionally here is a medium article you may find helpful to your development as well:
https://medium.com/clover-platform-blog/troubleshooting-common-clover-rest-api-error-codes-9aaa8885373

If you have implemented all of the troubleshooting steps, have reviewed the medium post, and are still experiencing this issue please let us know.
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community