question

oabylova avatar image
oabylova asked oabylova commented

Response of 401 when POSTing to ../merchant_id/customers

My access token seems to work just fine for fetching/creating most objects via the API endpoints and my app permissions are set to include read/write for customers, but when I try to post to endpoint: https://sandbox.dev.clover.com/v3/merchants/{mID}/customers -- the response is a 401 error.
API TokenCustomers
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.

Rohit Bhardwaj avatar image Rohit Bhardwaj commented ·
Hey @oabylova,

The base URL for Sandbox API environment is https://apisandbox.dev.clover.com/
So your endpoint URL will be https://apisandbox.dev.clover.com/v3/merchants/{mID}/customers
0 Likes 0 ·
Frank Faustino avatar image Frank Faustino ♦♦ Rohit Bhardwaj commented ·

Both URL's will work for making REST API calls to our Sandbox environment.

0 Likes 0 ·
Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ Frank Faustino ♦♦ commented ·

But you should be using apisandbox...

0 Likes 0 ·

1 Answer

·
Lee Tickett avatar image
Lee Tickett answered oabylova commented
Have you definitely got the customer write permission? It is in the process of being changed (broken down into smaller permissions) so this could also have an impact.
Don't forget, if you haven't got the permission and you add it, you will need to perform a sync before the change takes effect.
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.

oabylova avatar image oabylova commented ·

Hi Lee,

I definitely do have the permission, here is a screenshot: https://prnt.sc/oj5jgm. But quick question, when you say I 'need to perform a sync before the changes take effect', what do you mean? I've re-authed to make sure that the permissions are up to date.

0 Likes 0 ·
Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ oabylova commented ·

If you change the permission after the app is installed to a merchant you must uninstall, re-install the app to get the new permission.

2 Likes 2 ·
oabylova avatar image oabylova Jeffrey Blattman ♦♦ commented ·

Thank you Jeffrey! That worked, all is working well now.

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