question

mohit avatar image
mohit asked Jeffrey Blattman commented

How to get list of permissions of a merchant?

Hi,

I am trying to get the list of permissions for a particular merchant like this

https://community.clover.com/questions/429/merchant-permissions-are-incompleteinaccurate.html?childToView=24945#comment-24945

and I am using REST API. Right now there are few merchants with customer read rights and few are not so, I want to expose a particular API based on the permissions. Which API gives us the permissions?

REST API
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

·
Jeffrey Blattman avatar image
Jeffrey Blattman answered Jeffrey Blattman commented

You can think of permissions as belonging to the app, not the merchant. If the merchant has installed your app then they have allowed all the permissions you requested.

The caveat is if you've ever changed the permissions then your app won't get the new set until it is uninstalled and re-installed to the merchant.

I don't know of a way to get a list of granted permissions, but attempting the operation and seeing if it fails with a 401/403 is as a good as anything. If you want to avoid making failed calls you could set a persistent flag. You know that if it fails, it's going to always fail for this installation of the app.

2 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.

mohit avatar image mohit commented ·

okay, I am using order API and getting the orders along with the customer name

https://sandbox.dev.clover.com/v3/merchants/{mid}/orders/{orderId}?expand=customers

But at a later stage if I want to add permission of payment also how will I be distinguishing between which order API to call?

User A: Order Read Permission,

User B: Order Read Permission, Customer Read Permission.

User C: Order Read, Customer Read, Payment Read Permission.


0 Likes 0 ·
Jeffrey Blattman avatar image Jeffrey Blattman ♦♦ mohit commented ·
Try calling with payment expansion. If it fails with 401/403, call without it.
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