Square /oauth2/authorize 400

Hey!

I’m building an OAuth authorization URL, so that users of my app (Luhme) can click on it and connect their Luhme account to their Square one. The URL that gets built is https://connect.squareupsandbox.com/oauth2/authorize?client_id=xxx&scope=ITEMS_READ+PAYMENTS_WRITE+MERCHANT_PROFILE_READ&state=xxx.

However, when users get redirected to this link (by setting window.location.href in the client side JS, the URL is built by the API server), the page stays blank and a 400 error appears in the console. The response text is simply “Bad Request”. I don’t see any logs in the Square API dashboard either.

If you’d like to reproduce this, you can head over to demonstration.luhme.app/vendor and use the username “no POS vendor” and the password “test”.

If anyone has experienced this before, or has any ideas about how to solve this / how I could debug it, that would be much much appreciated!

Seamus

: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

Square Sandbox
OAuth API
OAuth API

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.

Nevermind, silly me, I needed to open the seller dash :person_facepalming:

Glad to hear that you figured it out. :slight_smile: