question

khurram avatar image
khurram asked khurram commented

Can anyone tell me how to use API Token in production environment?

I have created an API Token for the sandbox environment it works well but when I move to production it does not work although I have created a new API Token to use from the production dashboard. And also I did not know what would be URL for that as I have used "api.clover.com"

Production
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 converted comment to answer

There are no tricks, so, based on the lack of details we can't really help you. How are you creating the token? Is this being created from your merchant dashboard? What does "does not work" mean? Yes, api.clover.com is correct.

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

khurram avatar image khurram commented ·

I have generated the API token from the merchant account

0 Likes 0 ·
khurram avatar image khurram commented ·

Getting this error
1615389972863.png

0 Likes 0 ·
1615389972863.png (40.0 KiB)
David Marginian avatar image David Marginian ♦♦ khurram commented ·

In that screen shot you don't have the merchant id in the url, did you redact that or are you really not passing it? Are you sure your token has the correct permissions?

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

i have removed that for security purpose

0 Likes 0 ·
Show more comments
khurram avatar image khurram commented ·

The full process would be that

Currently, we are creating an admin dashboard that will take data from the clover of our restaurants and save it in our database. And then we can use this data to show on our site and apps.


Now when we hit the API it will give us an authentication error in a production environment.

0 Likes 0 ·
David Marginian avatar image
David Marginian Deactivated answered khurram commented

You have set-up an EComm token. EComm tokens have a public and a private key. The public key is used only for card tokenization, you need to use the private key for ALL other API calls. Are you sure you are using the private key?

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

khurram avatar image khurram commented ·

yes i am using the private but it gives 401 error.


"message": "401 Unauthorized"

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

The private token you generated works fine for me, I am getting 200s. Maybe you are not passing it correctly, see https://docs.clover.com/docs/using-api-tokens.

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

can you share pics how you used that


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