question

kelvin avatar image
kelvin asked kelvin commented

Missing isOwner in v3/employees API

If you use v3/merchants/current/employees to retrieve employee, the attribute isOwner is always null even for owner employee. Is this a known problem? when will it be fixed?

this attribute works fine in v2 API. we can't move to v3 API until this problem is fixed.

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.

Dan avatar image Dan ♦ commented ·

No plans to add (restore?) the isOwner field for v3/merchants/{mId}/employees. Presumably removed from the endpoint during the transition from v2 to v3. As JTickett answered, if the owner of a merchant is needed, expanding merchants on owner works. If the owner needs to be distinguished or excluded from the employees response, then users need to get the uuid from merchants and filter v3 employees.

0 Likes 0 ·

1 Answer

James Tickett avatar image
James Tickett answered kelvin commented

Hi Kelvin,

I know this isn't as neat of a solution but I hope its useful as a workaround. Try submitting the request without that "employees" bit on the end, like this: {URL}/v3/merchants/{mId}/

As part of the response you'll see the Owner object with its Employee ID. I just realised that you can actually expand on this using: {URL}/v3/merchants/{mId}/?expand=owner so that the Owner response is identical to viewing Owner as an Employee.

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.

James Tickett avatar image James Tickett commented ·

And if you were trying to achieve the opposite then once the Owner's ID is known, you can follow up with this to return all employees who are not Owner. /v3/merchants/CYVR1MX5PA92C/employees?filter=id!={OwnerEmployeeID}

0 Likes 0 ·
kelvin avatar image kelvin commented ·

Thanks for the reply. I am aware of the API to retrieve owner by merchants/{id}/. In fact, I am using v2 employees API it works just fine. I was just wondering if there is any plan to fix this issue for v3 API.

0 Likes 0 ·

Welcome to the
Clover Developer Community