Please help me to fix the invalid scope issue in eBay OAuth Token Using Refresh Token API. I am in production Mode. Even not the primary scope https://api.ebay.com/oauth/api_scope is working for me. I am using PHP.
$curlSecondHandler = curl_init();
curl_setopt_array($curlSecondHandler, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => "grant_type=refresh_token&refresh_token=".$refreshToken."&scope=".urlencode($scopes),
CURLOPT_HTTPHEADER => [
'Content-Type: application/x-www-form-urlencoded',
'Authorization: Basic ' . base64_encode($clientId . ':' . $certId)
],
]);
Make sure that the scopes are the same as the ones used during the consent request. You can also remove the scopes parameter to get all the scopes from the original consent request. If you wish to add more scopes, you would need to go through consent once again with the additional scopes and gain a new refresh_token. https://developer.ebay.com/api-docs/static/oauth-refresh-token-request.html