question

Sri Nalam avatar image
Sri Nalam asked ·

How to get oauth code

i have a simple web app and using Example OAuth Request i am able to get code (which is last part of the URL), now using that code i am able to get the access token and there by use the API, but how do i get the code for my regular orders, i dont think its feasible to click on this example everytime to get the code, there should be a way how others have built online ordering apps, kindly suggest how to get the code, may be i send login credentials over a web api call and then get the code generated
API TokenOAuth
13 comments
10 |2000 characters needed characters left characters exceeded

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

Hi @Sri Nalam,

I'm not sure I understand the question. Could you please elaborate and refer our guide for asking good, clear questions? Are you referring to generating the OAuth code when merchants install your app or when customers make an online order?

0 Likes 0 · ·

Yeah @Miguel, i need to generate the oauth code to get the access tokenand there by create order when end users like to place order from our website., kindly guide how to generate the code

0 Likes 0 · ·

At a high-level the flow is: After the merchant installs your app, they will be redirected to your app's url with the code parameter in the URL

https://yoursite.com/?code={code}&... 

If for some reason, you don't have the code, you can redirect the user to the following URL:

https://sandbox.dev.clover.com/oauth/authorize?client_id={appId}&redirect_uri={yoursiteurl}

Once you have the code, you then go through the OAuth flow. If successful, you will be returned the API token. You should securely store the API token. When customers make online orders, you will retrieve the token to make API calls.

If you are able to get the API token in sandbox, it should be the same process in production.

1 Like 1 · ·
Show more comments
pyronerd62 avatar image
pyronerd62 answered ·
I don't know if you've gotten this far but the production enpoint listed in the dev docs doesn't work. I get this to work instead https://www.clover.com/oauth/authorize?client_id=XXXXXXXXXXXXX I don't know if this is a bug or a typo. Maybe @Miguel can clarify the discrepancy.
Share
10 |2000 characters needed characters left characters exceeded

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

arvi avatar image
arvi answered ·
are you able to get auth code? I had trouble getting auth code in webhook. Can anyone show me some code snippet? which can help me?
Share
10 |2000 characters needed characters left characters exceeded

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