question

Obaid avatar image
Obaid asked sam Deactivated commented

How to get Authorization Bearer against merchant id

Hi,

How can I create the Authorization Bearer against merchant id, I know there is the OAuth documentation there , but can you please give me any example or piece of code.

I have this query string when merchant launch my app.
http://localhost:14145/?merchant_id=PSXXXXX8766&employee_id=XXX9XXXXX&client_id=XXXXXSWZXXXXXX&code=XXXXXXX-e982-8XXXX-8f0e-XXXXXXXXXX
API TokenAuth
10 |2000

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

1 Answer

Miguel avatar image
Miguel Deactivated answered sam Deactivated commented
The next step would be to send another request
https://sandbox.dev.clover.com/oauth/token?client_id={appId}&client_secret={appSecret}&code={codeUrlParam}
  • App ID: Your app's id
  • App Secret: You can get this from your application dashboard
  • Code: You get this from the previous response you received
On a succesful request, the response will include the API token that can be used to make subsequent API calls.

All of this is documented in our OAuth docs: https://docs.clover.com/build/oauth-2-0/
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.

Obaid avatar image Obaid commented ·

Hi @miguel

Thanks for your reply, I got the API token from below url, I triedyour given URL but it is not working.

https://api.clover.com:443/oauth/token?client_id={appId}&client_secret={appSecret}&code={codeUrlParam}

Well now I am facing 1 last problem :)

When I am fetching the employees list by predefined token it is working fine, but when I am going to fetch the employees list by that token which is generated by Access Token Method (OAuth above method) I got the error 401 Unauthorized.

0 Likes 0 ·
sam avatar image sam Obaid commented ·

You need to make sure the app that's generating the OAuth has the correct permissions.

Here's a quick video of how to build a WebApp with OAuth.

https://www.youtube.com/watch?v=6riNP_wlKcU

0 Likes 0 ·

Welcome to the
Clover Developer Community