The sandbox OAuth endpoints and credentials are different from production. Using production credentials against sandbox endpoints (or vice versa) will fail.
You can use the environment toggle in the top-right corner of the Developer Portal to switch between sandbox and production credentials.
All requests to sandbox endpoints — including the OAuth token endpoint — must include the X-Qonto-Staging-Token header.
Without it, the server may return a 302 redirect to the developer portal instead of a JSON response, which is a common and confusing failure.
This header is the programmatic-call bypass for our Sandbox OneLogin gate. For the full picture — including how to open Sandbox URLs in a browser — see Accessing the Sandbox environment.