question

aadel avatar image
aadel asked zgreathouse Deactivated edited

Custom Employee Roles Are Retrieved as EMPLOYEE

Hi,

Currently, employees with custom roles created using the UI are retrieved as EMPLOYEE from REST API V2. Are there plans to support custom roles in the API?

End point: https://apisandbox.dev.clover.com/v3/merchants/mId...
Environment: Sandbox

Thanks,
A.
REST APISandboxEmployees
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

Raymond Lee avatar image
Raymond Lee Deactivated answered aadel commented
The "role" field will always show the "system role", as custom roles are system roles with modified permissions.

If you need to see if the employee belongs to a custom role, you can expand the "roles" field to see the "name" of the role they are in.
GET /v3/merchants/{
                {merchantId}}/employees?expand=roles

Here is an example expanded response of an employee with a custom role named "CustomEmployeeRole":
            "href": "https://sandbox.dev.clover.com/v3/merchants/BWKG25CF5F89J/employees/C953DJN87AEDP",
            "id": "C953DJN87AEDP",
            "name": "Custom Employee",
            "nickname": "Custom",
            "inviteSent": false,
            "pin": "1212",
            "role": "EMPLOYEE",
            "roles": {
                "elements": [
                    {
                        "href": "https://sandbox.dev.clover.com/v3/merchants/T0JBWKG25CF5F89J/roles/CRADD3CKC54UD",
                        "id": "CRADD3CKC54UD",
                        "name": "CustomEmployeeRole",
                        "systemRole": "EMPLOYEE",
                        "merchant": {}
                    }
                ]
            },

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.

aadel avatar image aadel commented ·
Works exactly as expected, thanks!

In the question though, API Version should be 3 instead of 2.
0 Likes 0 ·

Welcome to the
Clover Developer Community