Connect more than one project id to the Google Play Developer Console

To reemphasise @andy's comment: There can only be one single linked API project.

I spend quite some time to find this out. Google's documentation is not helpful here.

If you need access to multiple projects/applications, you have to create multiple service accounts inside of the single linked API project and manages access to apps individually.


Andy's comment is correct, I find the description LINKED PROJECT in the Google Play Developer Console confusing at best.

However, I setup in the Google Developers Console a company project with the appropriate Server Keys and Service accounts. It isn't ideal, but it works. You can then assign permission to the required service account back in the Google Play Developer Console.

You can also setup just one key and service account if that makes it simpler and the use them as shown below in PHP for a server

$service_account_name = '[email protected]';
$key_file_location = somedir/keyfile.p12;

$client = new Google_Client();
$client->setApplicationName("GoogleDevelopersConsoleProjectName");
$service = new Google_Service_AndroidPublisher($client);

$key = file_get_contents($key_file_location);
$cred = new Google_Auth_AssertionCredentials(
    $service_account_name,
    array('https://www.googleapis.com/auth/androidpublisher'),
    $key
);

$client->setAssertionCredentials($cred);

if($client->getAuth()->isAccessTokenExpired()) {
  $client->getAuth()->refreshTokenWithAssertion($cred);
}  

$apiKey = "GoogleDevelopersConsoleServerKey";
$client->setDeveloperKey($apiKey);

$package_name = "com.yourcompany.yourappname1";

Then all you need to do for the other application is change the $package_name.

$package_name = "com.yourcompany.yourappname2";

Then using the Google Service AndroidPublisher to query subscriptions

$service = new Google_Service_AndroidPublisher($client);

$results = $service->purchases_subscriptions->get($package_name,$subscriptionId,$token,array());

You can also start to assign multiple keys, service accounts and other credentials you add other projects in the Google Play Developer Console.