PHPackages                             cantie/app-store-connect-api - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. cantie/app-store-connect-api

ActiveLibrary[API Development](/categories/api)

cantie/app-store-connect-api
============================

A PHP client library for accessing App Store Connect APIs

v1.35.0(9mo ago)2942.4k↓39.4%15[3 issues](https://github.com/cantie/app-store-connect-api-php/issues)[2 PRs](https://github.com/cantie/app-store-connect-api-php/pulls)MITPHPPHP ^7.4|^8.0

Since Jun 16Pushed 3mo ago3 watchersCompare

[ Source](https://github.com/cantie/app-store-connect-api-php)[ Packagist](https://packagist.org/packages/cantie/app-store-connect-api)[ RSS](/packages/cantie-app-store-connect-api/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (7)Dependencies (5)Versions (8)Used By (0)

App Store Connect APIs Client Library for PHP
=============================================

[](#app-store-connect-apis-client-library-for-php)

[![GitHub Release](https://camo.githubusercontent.com/59e47609475b19004013c702128266867ee5a11e8bcb2e5bf06f91eaf6ab2f9a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f63616e7469652f6170702d73746f72652d636f6e6e6563742d617069)](https://camo.githubusercontent.com/59e47609475b19004013c702128266867ee5a11e8bcb2e5bf06f91eaf6ab2f9a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f762f72656c656173652f63616e7469652f6170702d73746f72652d636f6e6e6563742d617069)[![Packagist Downloads](https://camo.githubusercontent.com/9773362bf812cde180fb5a0a90e5ea172d55f37465cd421b21924b6616d5f3d1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63616e7469652f6170702d73746f72652d636f6e6e6563742d617069)](https://camo.githubusercontent.com/9773362bf812cde180fb5a0a90e5ea172d55f37465cd421b21924b6616d5f3d1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f63616e7469652f6170702d73746f72652d636f6e6e6563742d617069)[![Packagist License](https://camo.githubusercontent.com/19c9fec08c52a7d28d378b32cecfd1ea22ddcab0b0b350c5096e89381ec4718b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f63616e7469652f6170702d73746f72652d636f6e6e6563742d617069)](https://camo.githubusercontent.com/19c9fec08c52a7d28d378b32cecfd1ea22ddcab0b0b350c5096e89381ec4718b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f63616e7469652f6170702d73746f72652d636f6e6e6563742d617069)[![Packagist Dependency Version](https://camo.githubusercontent.com/7bfdb19bd76b6df7539afe2d49fc00d78984d8306d8889d92082e280f2beefac/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f63616e7469652f6170702d73746f72652d636f6e6e6563742d6170692f706870)](https://camo.githubusercontent.com/7bfdb19bd76b6df7539afe2d49fc00d78984d8306d8889d92082e280f2beefac/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f63616e7469652f6170702d73746f72652d636f6e6e6563742d6170692f706870)

This library enables the automation of actions you take in App Store Connect. Its client was modified from [Google API PHP Client](https://github.com/googleapis/google-api-php-client) and i just added some resources for App Store Connect APIs.

Installation
------------

[](#installation)

The preferred method is via [composer](https://getcomposer.org/). Follow the [installation instructions](https://getcomposer.org/doc/00-intro.md) if you do not already have composer installed.

Once composer is installed, execute the following command in your project root to install this library:

```
composer require cantie/app-store-connect-api
```

Examples
--------

[](#examples)

See the [`examples/`](examples) directory for examples of some APIs. You can view them in your browser by running the php built-in web server.

```
$ php -S localhost:8000 -t examples/

```

And then browsing to the host and port you specified (in the above example, `http://localhost:8000`).

### Basic Example

[](#basic-example)

```
use AppleClient;
use AppleService_AppStore;
use Cantie\AppStoreConnect\Services\AppStore\CustomerReviewResponseV1CreateRequest;

$client = new AppleClient();
$client->setApiKey("PATH_TO_API_KEY");
$client->setIssuerId($issuerId);
$client->setKeyIdentifier($keyIdentifier);

$appstore = new AppleService_AppStore($client);
// Get apps by Bundle ID
$results = $appstore->apps->listApps([
    "filter[bundleId]" => "YOUR_BUNDLE_ID" // filter LIKE
]);

// Get all customer reviews for each app
foreach ($results->getData() as $app) {
    $appCustomerReviews = $appstore->apps->listAppsCustomerReviews($app->getId());
    foreach ($appCustomerReviews as $appCustomerReview) {
        // Print all reviewer's nickname
        $appCustomerReview->getAttributes()->getReviewerNickName(), " \n";

        // Get response for this review
        $customerReviewResponseV1Response = $appstore->customerReviews->getCustomerReviewsResponse($appCustomerReview->getId());

        // Create or update response for this review
        $postBody = new CustomerReviewResponseV1CreateRequest([
            'data' => [
                'attributes' => [
                    'responseBody' => "YOUR_REPLY_TEXT_HERE"
                ],
                'relationships' => [
                    'review' => [
                        'data' => [
                            'id' => $appCustomerReview->getId()
                        ]
                    ]
                ]
            ]
        ]);
        $customerReviewResponseV1Response = $appstore->customerReviewResponses->createCustomerReviewResponses($postBody);

        // Or just delete the response if existed
        $appstore->customerReviewResponses->deleteCustomerReviewResponses($customerReviewResponseV1Response->getData()->getId());
    }
}
```

### Create new client

[](#create-new-client)

```
use AppleClient;

$client = new AppleClient();
$client->setApiKey("PATH_TO_API_KEY");
$client->setIssuerId($issuerId);
$client->setKeyIdentifier($keyIdentifier);
// Optional: create new JWT token. If skip this step, token are auto generated when first request are sent
$client->generateToken();
```

### Making a request

[](#making-a-request)

For almost all request except upload service, we use AppStore service to handle

```
use AppleService_AppStore;
// All resources and their methods parameters are listed in src/Service/AppStore.php
$appstore = new AppleService_AppStore($client);
// Make request, for example we call request for an Apps's resources
$appstore->apps->listAppsAppStoreVersions($APP_ID_HERE, $OPTIONAL_PARAMS);
```

For detail, you can view in src/Services/AppStore/Resource/\*

### Aliases

[](#aliases)

Basic classes are aliased for convenient use, see more at src/aliases.php

```
$classMap = [
    'Cantie\\AppStoreConnect\\Client' => 'AppleClient',
    'Cantie\\AppStoreConnect\\Service' => 'AppleService',
    'Cantie\\AppStoreConnect\\Services\\AppStore' => 'AppleService_AppStore',
    'Cantie\\AppStoreConnect\\Services\\Upload' => 'AppleService_Upload'
];
```

### Upload assets to App Store Connect

[](#upload-assets-to-app-store-connect)

In this example we will upload one screenshot file to app screenshot set

```
// Firstly, we get app screenshot set step by step, we can reduce steps by include[] parameters in query
use AppleService_Upload;
use Cantie\AppStoreConnect\Services\AppStore\AppScreenshotCreateRequest;
use Cantie\AppStoreConnect\Services\AppStore\AppScreenshotUpdateRequest;

$appId = $app->getId(); // $app from previous example
$appStoreVersions = $appstore->apps->listAppsAppStoreVersions($appId);
// Get first app store version id;
$appStoreVersionId = $appStoreVersions->getData()[0]->getId();
// Get list localizations of this version
$appStoreVersionLocalizations = $appstore->appStoreVersions->listAppStoreVersionsAppStoreVersionLocalizations($appStoreVersionId);
// Get first localization id
$appStoreVersionLocalizationId = $appStoreVersionLocalizations->getData()[0]->getId();
// Get list app screenshot sets for this localization
$appScreenshotSets = $appstore->appStoreVersionLocalizations->listAppStoreVersionLocalizationsAppScreenshotSets($appStoreVersionLocalizationId);
// Get first set id
$appScreenshotSetId = $appScreenshotSets->getData()[0]->getId();

// Now, we make an asset reservation
$fileName = "YOUR_FILE_NAME";
$filePath = "FULL_PATH_TO_YOUR_FILE" . $fileName;
$requestCreateAppScreenshot = new AppScreenshotCreateRequest([
    'data' => [
        'type' => 'appScreenshots',
        'attributes' => [
            'fileSize' => filesize($filePath),
            'fileName' => $fileName
        ],
        'relationships' => [
            'appScreenshotSet' => [
                'data' => [
                    'type' => 'appScreenshotSets',
                    'id' => $appScreenshotSetId
                ]
            ]
        ]
    ]
]);
// Create new app screenshot
$appScreenshot = $appstore->appScreenshots->createAppScreenshots($requestCreateAppScreenshot);
$appScreenshotId = $appScreenshot->getData()->getId();
// Follow instruction from UploadOperation[] return in $appScreenshot to upload part or whole asset file
// We can upload parts of your asset concurrently
foreach ($appScreenshot->getData()->getAttributes()->getUploadOperations() as $uploadOperation) {
    $upload = new AppleService_Upload($client, $uploadOperation); // $client from above example
    $ret = $upload->uploadAssets->upload($uploadOperation, $filePath);
}
// Finally, commit the reservation
$appScreenshotUpdateRequest = new AppScreenshotUpdateRequest([
    'data' => [
        'type' => 'appScreenshots',
        'id' => $appScreenshotId,
        'attributes' => [
            'sourceFileChecksum' => md5_file($filePath),
            'uploaded' => true
        ]
    ]
]);
$ret = $appstore->appScreenshots->updateAppScreenshots($appScreenshotId, $appScreenshotUpdateRequest);
```

### Initialize classes

[](#initialize-classes)

All object classes are extended from Model.php can be initialized by an array of attribute names and values, as previous example:

```
use Cantie\AppStoreConnect\Services\AppStore\AppScreenshotUpdateRequest;
$appScreenshotUpdateRequest = new AppScreenshotUpdateRequest([
    'data' => [
        'type' => 'appScreenshots',
        'id' => $appScreenshotId,
        'attributes' => [
            'sourceFileChecksum' => md5_file($filePath),
            'uploaded' => true
        ]
    ]
]);
```

### Caching

[](#caching)

JWT token are cached for 10 minutes and only be created if doesn't existed or has been expired. JWT token is not shared between clients. Each client has its own token as defined in src/Client.php

```
public function generateToken()
{
    $tokenGenerator = new Generate($this->getApiKey(), $this->getKeyIdentifier(), $this->getIssuerId());
    $jwtToken = $tokenGenerator->generateToken();
    // cache for 10 minutes
    $this->jwtToken = $jwtToken;
    $this->jwtTokenExpTime = (new DateTime())->modify("+10 minutes")->getTimestamp();
    return $jwtToken;
}
```

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance69

Regular maintenance activity

Popularity43

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.9% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~137 days

Recently: every ~194 days

Total

7

Last Release

287d ago

Major Versions

v0.9.2-beta → v1.02023-12-15

### Community

Maintainers

![](https://www.gravatar.com/avatar/89d4f62579d0c44055a4c23c414128adb02c80c6cf9e3cb2b4a269a32b4fc08a?d=identicon)[cantie](/maintainers/cantie)

---

Top Contributors

[![cantie](https://avatars.githubusercontent.com/u/2767447?v=4)](https://github.com/cantie "cantie (50 commits)")[![alikemalcivelek](https://avatars.githubusercontent.com/u/20399827?v=4)](https://github.com/alikemalcivelek "alikemalcivelek (2 commits)")[![luanmm](https://avatars.githubusercontent.com/u/1708808?v=4)](https://github.com/luanmm "luanmm (1 commits)")[![qcgzxw](https://avatars.githubusercontent.com/u/24518597?v=4)](https://github.com/qcgzxw "qcgzxw (1 commits)")[![ugurgungezerler](https://avatars.githubusercontent.com/u/6935893?v=4)](https://github.com/ugurgungezerler "ugurgungezerler (1 commits)")

---

Tags

apiapi-clientapp-storeapp-store-connectappleappstoreappstoreconnectappstoreconnectapilaravellaravel-frameworkphpphpappleappstoreappstore-api

###  Code Quality

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/cantie-app-store-connect-api/health.svg)

```
[![Health](https://phpackages.com/badges/cantie-app-store-connect-api/health.svg)](https://phpackages.com/packages/cantie-app-store-connect-api)
```

###  Alternatives

[google/apiclient

Client library for Google APIs

9.8k205.9M1.1k](/packages/google-apiclient)[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[google/cloud

Google Cloud Client Library

1.2k16.7M57](/packages/google-cloud)[google/cloud-core

Google Cloud PHP shared dependency, providing functionality useful to all components.

346132.9M112](/packages/google-cloud-core)[tempest/framework

The PHP framework that gets out of your way.

2.2k34.4k15](/packages/tempest-framework)[googleads/googleads-php-lib

Google Ad Manager SOAP API Client Library for PHP

68010.5M25](/packages/googleads-googleads-php-lib)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
