cdcilley avatar image
cdcilley asked Raymond Lee Deactivated commented

Android and OAuth for Clover Web-App

I'm building a merchant-specific Android application for creating orders in their proprietary invoice/inventory system/database. Clover does not allow merchant-specific Android applications. In a support email conversation, @Lilly suggested I use a Web-app and the Clover REST API.

I built a little test app using the Android OAuth Example and successfully got back the Access/API token. I have a few clarification questions about (hopefully) using this token in my Android app.
  1. The token expires after one year, correct? I will, of course, build in error trapping to catch when it expires.
  2. Is the token tied to that merchant account? Is there a single token per merchant? In other words, if the merchant is using 5 Clover stations, can REST calls from those 5 stations use that single token?
  3. This is probably more for @Raymond Lee... Am I wrong in thinking that I can use that API token to build http REST calls in my Android code in order to Create Orders and get Payment Information (really the only two things I need from Clover since the app passes off to Intent com.clover.intent.action.PAY with OrderId for the actual payment transaction).
In short, can I use an API-token for REST API calls in an Android app (side-loaded and not from the Clover App Market) that does not include the Clover SDK in order to create orders and pull payment information?
10 |2000

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

Raymond Lee avatar image
Raymond Lee Deactivated answered Raymond Lee Deactivated commented
Hi @cdcilley,

Here are my answers below:
1. The Access/API token currently does not expire, so it will only become invalid if the merchant uninstalls your app. If the merchant reinstalls your app after that, you would need to get a new API token. In the future we are planning on setting an expiration date on API tokens, but we will also provide a refresh token to renew the token. I do not have an ETA for when that would be rolled out, so for now, API tokens do not expire.

2. Yes, the token is tied to the merchant account, and is device agnostic; you can use the same API token from any number of Clover devices under that merchant. There is no single dedicated token per merchant, you will notice if you go through the OAuth process again, you will receive a different API token. Although it is easier to just retrieve the API token once, and reuse that same one.

3. You are correct, you can use that API token in your Android code to build REST calls to create orders and retrieve Payment information.

Yes, you can use an API-token for REST API calls in an Android app that is side-loaded without using the Clover SDK to create Orders and retrieve Payment information. However keep in mind that side-loading is only for development and testing; it is only possible on devkits. So this will only work in the Sandbox environment with Sandbox devkits, and not in Production environment with Production Clover devices.

Hope that helps,

10 |2000

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

cdcilley avatar image cdcilley commented ·

Hmmm... I guess there should have been a little more research on our part before starting this project, and not to have taken the Clover sales rep's assurance that "you can run android apps" at face value. If there is no browser and no way to install a vanilla Android application on them, I think my client might need to return their Clover Stations.

Perhaps another route... I was reading about other integration pathways in the developer docs and came across Clover Go BYOD (Beta). Am I wrong to think (hope) that this can get us where we need to be? Attaching a Clover Go to a tablet running our custom Android app on our own hardware, able to create orders and process payments much like what we hoped to do on the Clover Station?

0 Likes 0 ·
Raymond Lee avatar image Raymond Lee cdcilley commented ·

Yes, Clover Go would be a suitable alternative, since if you would be using your own Android device, you can side-load your app to the Android device. Your app can then use the Clover Go device to take payments, and use REST API calls to create Orders.

0 Likes 0 ·
Nigel Reid avatar image
Nigel Reid answered Raymond Lee Deactivated commented
Getting 404 at testing. Site URL was done with api setup. Test authorized with api key. Got to the site however, 404 on app page. Can you help?
10 |2000

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