@bates-solutions/squareup API Reference - v3.2.0
    Preparing search index...

    Function buildAuthorizeUrl

    • Build the URL that sends a seller to Square to authorize your application (OAuth code flow). Pure function — no network call.

      Parameters

      Returns string

      const url = buildAuthorizeUrl({
      clientId: process.env.SQUARE_APP_ID!,
      environment: 'production',
      scopes: ['ORDERS_READ', 'MERCHANT_PROFILE_READ'],
      state: csrfToken, // random per attempt; store it server side to check in the callback
      });
      // redirect the seller to `url`