Sandbox url is not working

$authorizeUrl = $squareEnv == ‘sandbox’
? ‘https://connect.squareupsandbox.com/oauth2/authorize
: ‘https://connect.squareup.com/oauth2/authorize’;

this is working in production but not in the sandbox

:waving_hand: I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:

Additional Documentation

https://developer.squareup.com/docs/oauth-api/walkthrough2
Create the Redirect URL and Square Authorization Page URL
Move OAuth from the Sandbox to Production

If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.

Do you have the sandbox Dashboard open when trying to Authorize? That’s a requirement when testing OAuth in sandbox. :slight_smile: