Search code examples
oauth

Stockx Authentication


We are having issues setting up StockX authentication. We have been following the documentation at https://developer.stockx.com/portal/authentication/, but we are not sure if the docs are outdated.

stockx docs example

We copied the exact cURL request (as shown in the image) and replaced it with our client ID, secret, and URI; however, it only returned the access token and not the refresh token.

stockx oauth token response


Solution

  • Add the offline_access scope to your authorization request. The offline_access scope tells the authorization server that your application requires a refresh token which will allow you to access the application. Then utilize the Authorization Code Flow to change an authorization code into tokens which include a refresh token.