Build the URL that sends a merchant to Clover to authorize your app (v2
OAuth code flow, expiring tokens). Pure function, no network call.
Clover has no per-request scopes: the app's permissions are set in the
Developer Dashboard. The redirect carries code, merchant_id and state
query parameters; keep merchant_id for createCloverClient, since the
token response does not include it.
consturl = buildAuthorizeUrl({ clientId:process.env.CLOVER_APP_ID!, environment:'production', state:csrfToken, // random per attempt; store it server side to check in the callback redirectUri:'https://example.com/clover/callback', }); // redirect the merchant to `url`
Build the URL that sends a merchant to Clover to authorize your app (v2 OAuth code flow, expiring tokens). Pure function, no network call.
Clover has no per-request scopes: the app's permissions are set in the Developer Dashboard. The redirect carries
code,merchant_idandstatequery parameters; keepmerchant_idforcreateCloverClient, since the token response does not include it.