question

webforte avatar image
webforte asked bryanvargas commented

401 unauthorized in API response

e-commerce api
3 comments
10 |2000

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

essg avatar image essg commented ·

I have been fiddling with this for over a week now... I have a merchant account with Clover... I logged in to the Merchant account and created an "API Token"

When I try to use that token to do a Get request from Postman to

https://api.clover.com/v3/merchants/{mymerchantid}

Using my Merchant ID I got from the merchant account.

Setting Authorization to "Bearer Token" and entering the "Private Token" I got..... I always get "401 Unauthorized".

I made sure to give full rights to this token... I checked all the boxes in permissions.

What am I missing here?

0 Likes 0 ·
essg avatar image essg essg commented ·

Are you kidding me right now!?!? I found out my problem.... why the heck does the Clover Merchants listing have a column called "MID" that is NOT the Merchant ID?

So Stupid! This whole time I have been using the wrong Merchant ID.
Hopefully this helps someone else in the future... your Merchant ID is not just numbers... it's the code listed UNDER the Merchant name... not the numbers in the "MID" column.


0 Likes 0 ·
bryanvargas avatar image bryanvargas ♦♦ essg commented ·
0 Likes 0 ·
David Marginian avatar image
David Marginian Deactivated answered

Tokens need to have the correct permissions for the call you are making (in this case, Customer Read) - https://community.clover.com/articles/23744/resolving-401-unauthorized-responses-when-making-a.html.

10 |2000

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

webforte avatar image
webforte answered David Marginian Deactivated commented

In the documentation https://docs.clover.com/docs/using-oauth-20, i am using step 2 token to get access_token via API (https://sandbox.dev.clover.com/oauth/token?client_id={appId}&client_secret={APP_SECRET}&code={AUTHORIZATION_CODE}), but getting 401 when using this fetched access_token as authorization header in API https://scl-sandbox.dev.clover.com/v1/customers

1 comment
10 |2000

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

David Marginian avatar image David Marginian ♦♦ commented ·

I answered your question below:

Tokens need to have the correct permissions for the call you are making (in this case, Customer Read) - https://community.clover.com/articles/23744/resolving-401-unauthorized-responses-when-making-a.html.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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