What is the OAuth2 Authorize URL?

I’ve looked at the Build With OAuth page https://developer.squareup.com/docs/oauth-api/build-with-oauth and I see the variables with the url data


But I don’t see documented any where what the actual values are. How do I create the link for a user to grant my application authorization to do payment transactions on their behalf?

I’m using .Net, is the url info in the SDK, if so where would I find it?


Hi @RussPete, in Step 2.1 it references a PHP template file which has these values.

To reference here:
_SQ_SANDBOX_DOMAIN = “connect.squareupsandbox.com
_SQ_DOMAIN = “connect.squareup.com
_SQ_AUTHZ_URL = “/oauth2/authorize”

I know this reply may be late. Below is the code I use to generate the URL in C#. More information can be found here.


    /// <summary>
    /// Builds a URL for authorizing application
    /// </summary>
    /// <remarks><a href="https://developer.squareup.com/docs/oauth-api/how-oauth-works"/></remarks>
    /// <param name="squareEnvironment">environment</param>
    /// <param name="squareApplicationId">client_id</param>
    /// <param name="scope">permissions</param>
    /// <returns>URL to authorize application access to merchant </returns>
    string AuthorizationUrl(string squareEnvironment, string squareApplicationId, string scope)
        string authorizationBaseUrl = squareEnvironment == "Production" ?
            "https://connect.squareup.com/" : "https://connect.squareupsandbox.com/";

        var sb = new StringBuilder();
        string url = sb.ToString();

        return url;


    string url = AuthorizationUrl(

Last thing - this question should be tagged with NET as well.