question

klatimer avatar image
klatimer asked Miguel Deactivated answered

Generating OAuth code programatically?

Is there a way to obtain an OAuth code programatically, i.e. without a human user logging in? I am trying to query the REST API for my business's merchant account, and I would like to be able to pull down data automatically. Correct me if I am wrong, but once I generate the code parameter, I will then be able to make a request using 'https://sandbox.dev.clover.com/oauth/token?clientid={appId}&clientsecret={appSecret}&code={codeUrlParam}'.

OAuth
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

If the merchant is directed to your site without the code parameter, you will need to redirect them to

https://sandbox.dev.clover.com/oauth/authorize?client_id={appId(s)}&redirect_uri={your site's redirect URL}

If the merchant is not already signed into Clover, they will be required to log in. There's not a way generate the code parameter without the merchant being logged in. You can read more about our OAuth flow in our Developer Docs: https://docs.clover.com/build/oauth-2-0/

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