Paypal API get authorisation code from code

I've implemented a Paypal Connect button. This returns a code parameter in the query string.

I'm unsure as to how to then turn this into an access code. The following code returns a (400) Bad Request error on the CreateFromAuthorizationCode() line:

var config = ConfigManager.Instance.GetProperties();
var oAuthCredential = new OAuthTokenCredential(
    Code.Settings.AssetStore.AssetStorePaypalAccountClientID,
    Code.Settings.AssetStore.AssetStorePaypalAccountSecret,
    config);
var accessToken = oAuthCredential.GetAccessToken();
var apiContext = new APIContext(accessToken);

var n = new CreateFromAuthorizationCodeParameters();
n.SetCode(paypalLoginCode);
n.setClientId(Code.Settings.AssetStore.AssetStorePaypalAccountClientID);
n.setClientSecret(Code.Settings.AssetStore.AssetStorePaypalAccountSecret);
n.SetGrantType("authorization_code");
n.SetRedirectUri("https://www.constructdev.net/en/game-assets/seller-account/cashout/create");

var info = Tokeninfo.CreateFromAuthorizationCode(apiContext, n);
Response.Write(info.access_token);
Response.End();

The Paypal API's seem a bit of a mess, any help on how to get the code at this point would be much appreciated.