question

marc-omorain avatar image
marc-omorain asked marc-omorain commented

How can you access the current Merchant (v3) in the Android SDK

Hi Jeff,

I'm trying to access the merchant's owner to get the owner's email address.

Using the V1 MerchantConnector I can get a V1 merchant object, but this doesn't allow access to the owner field.

The V3 Merchant class has the owner property that I want to access, but I can't find a way to get access to the current Merchant using the V3 API.

Is there a way to get the V3 merchant object? Or otherwise any method to get the owner's email address?

Thanks,

Marc

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.

marc-omorain avatar image marc-omorain commented ·

Hi there, any updates on this?

0 Likes 0 ·
hammer avatar image
hammer answered

The android SDK only works w/ the v1 merchant. You can use the v3 REST api and parse the response into a v3 merchant object.

10 |2000

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

jawheele avatar image
jawheele answered

Hello!

There's an example on how to obtain owner information using only the android SDK here:

https://github.com/clover/android-exa...

The idea is to use the EmployeeConnector object to get all employees and loop through them, each time calling the employee's isOwner method.

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 answered James Tickett commented

Hi Marc,

Looping through Employees until finding owner does work, although there are other requests you can try that might be more straight to the point.

This looks like a blank request but it actually queries the Merchant: {environment}/v3/merchants/{MID}/

To take it a step further you can expand on fields you find important: {environment}/v3/merchants/{MID}/?expand=address,owner,properties

I'm not 100% on this and wouldnt mind someone from Clover confirming, but I believe only the owner can have Admin role: {environment}/v3/merchants/{MID}/employees?filter=role=admin

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.

James Tickett avatar image James Tickett commented ·

I actually ended up using MerchantConnector and retrieving the v1 Merchant object, then doing something a bit hacky to gain access to the fields that I thought were only in the v3 Merchant e.g. owner, address etc.

0 Likes 0 ·

Welcome to the
Clover Developer Community