question

bassem avatar image
bassem asked David Marginian Deactivated commented

Test clover api with postman

Is it possible to test the clover api with postman without creating an android app and publish it in the clover market ?


Could you give me the list of prerequisites to test the REST API in postman ?


Thank you

REST APIAPI Token
10 |2000

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

David Marginian avatar image
David Marginian Deactivated answered David Marginian Deactivated edited

Yes, of course. Please see our docs - https://docs.clover.com/docs/clover-development-basics-web-app. Generally, you will still create a Clover app (web/REST Clients) and then obtain a token via the OAuth flow (once the app has been installed - see https://docs.clover.com/docs/merchant-interaction). For testing you could also use a merchant token.

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

nmonroehlk avatar image nmonroehlk commented ·

But how would this be done with an external website? I am getting tripped up on getting the auth code programmatically to be able to access the REST API.


We are building an interaction on our client's website that needs to create a new customer in the Clover data, but nothing else. We do not need an app installed into merchant machines. This is completely web-based. Is this even possible? I feel like it is, but cannot seem to find anything on generating the auth code for production use.

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ nmonroehlk commented ·

If this is for a single merchant, you can use a merchant token. In order to use OAuth tokens an app is required.

0 Likes 0 ·
nmonroehlk avatar image nmonroehlk David Marginian ♦♦ commented ·

We are trying to use the REST API to create a new customer based on a generic contact form on the client's website. That means we want the website to communicate with Clover and save that information as a new customer. This would not have any interaction with a Clover device other than the customer would then be searchable in the list of customers after the API call had completed.

0 Likes 0 ·
Show more comments
Richelle Herrli avatar image Richelle Herrli ♦♦ nmonroehlk commented ·

Clover apps can be completely web-based; they do not always need an Android APK. You can find more about web-based apps here.

0 Likes 0 ·
Richelle Herrli avatar image
Richelle Herrli answered David Marginian Deactivated commented

You can follow the steps in this Medium article to connect Clover REST API to Postman.

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

nmonroehlk avatar image nmonroehlk commented ·

I am attempting to build a similar web-based interface for my client. The issue that always stops me is getting the CODE programmatically. Almost all instructions to do this assume a developer account and therefore the API token can be generated by the Clover Admin UI.


How would one send the auth request to get an authorized code without using a web interface?

1 Like 1 ·
David Marginian avatar image David Marginian ♦♦ nmonroehlk commented ·

If you are building your integration for a single Clover merchant you can just use a merchant token.

If not, then you are kind of missing the point behind OAuth. In order to get a "code" the merchant MUST authorize you access to their data and thus the OAuth flow cannot be strictly programmatic.

0 Likes 0 ·
nmonroehlk avatar image nmonroehlk David Marginian ♦♦ commented ·

I understand that for OAuth 2.0 there must be an authentication step first. I am just trying to understand how that would work in a server-to-server model and if Clover supports that type of interaction without a human having to type in login information. The authentication would still have to occur. This will all be handled server-side, so the communication would be secured and not exposed to the Internet.

0 Likes 0 ·
Richelle Herrli avatar image Richelle Herrli ♦♦ nmonroehlk commented ·

Can you clarify how it is you would like to access your client's information?


To get a merchant token programmatically, you will need to run through the OAuth flow (as mentioned by David Marginian). To run through OAuth, you will need a developer account as well as a Clover app. There is no way to set up automatic token access without first creating a Clover developer account as well as a Clover app.

0 Likes 0 ·
sercanmobilist avatar image sercanmobilist commented ·

I can't run your web services with postman. I am facing auth 2.0 issue. can you help me.

The error I get in postman
Error: Could not complete OAuth 2.0 token request

if its content

response Body
{"message":"Client Id and client secret must be set"}

postman redirects me to the browser and tells me that I can successfully auth 2.0.
the following message is the successful message I get on the browser side
"

Your call is authenticated

A new window should open directing you back to the Postman app. If nothing happens, check to make sure your browser allows pop-ups.

"
gives the answer.

but it gives such an error in postman. So I can't send requests to your services.

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ sercanmobilist commented ·

It appears as if you are trying to obtain an OAuth token via API and are not passing in the client_id and client_secret parameters, please see https://docs.clover.com/docs/using-oauth-20#step-3-request-an-api-token.

0 Likes 0 ·
Show more comments

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