PHPackages                             brad/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. brad/app-store-connect-api

ActiveLibrary[API Development](/categories/api)

brad/app-store-connect-api
==========================

A PHP client library for accessing App Store Connect APIs

v0.1.2(9mo ago)01MITPHP

Since Aug 4Pushed 9mo agoCompare

[ Source](https://github.com/wenshunbiao/app-store-connect-api-php)[ Packagist](https://packagist.org/packages/brad/app-store-connect-api)[ RSS](/packages/brad-app-store-connect-api/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (2)Used By (0)

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

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

[![Latest Stable Version](https://camo.githubusercontent.com/6f22be9542afdd3975ef86e0111cc4b5fa4b22543b2ccad6c99a544f430b8534/687474703a2f2f706f7365722e707567782e6f72672f63616e7469652f6170702d73746f72652d636f6e6e6563742d6170692f76)](https://packagist.org/packages/cantie/app-store-connect-api) [![Total Downloads](https://camo.githubusercontent.com/c11d4888914da8cc3af48a6b4cec14e2783ceeca73c5fc1b60cffd413d99300a/687474703a2f2f706f7365722e707567782e6f72672f63616e7469652f6170702d73746f72652d636f6e6e6563742d6170692f646f776e6c6f616473)](https://packagist.org/packages/cantie/app-store-connect-api) [![Latest Unstable Version](https://camo.githubusercontent.com/f23c277903407018ccacb7cd7238f9a91ec66eb287ba3f96c6fee7616e351021/687474703a2f2f706f7365722e707567782e6f72672f63616e7469652f6170702d73746f72652d636f6e6e6563742d6170692f762f756e737461626c65)](https://packagist.org/packages/cantie/app-store-connect-api) [![License](https://camo.githubusercontent.com/f17bd91f95cd8373fa39b0ccf858627f6749347d5f0b0dc1eb0b2760e7b94c40/687474703a2f2f706f7365722e707567782e6f72672f63616e7469652f6170702d73746f72652d636f6e6e6563742d6170692f6c6963656e7365)](https://packagist.org/packages/cantie/app-store-connect-api) [![PHP Version Require](https://camo.githubusercontent.com/b5f09a5d60562d2de2979bd2736b559e8b4fa58afe0a080c8dd13550de482f72/687474703a2f2f706f7365722e707567782e6f72672f63616e7469652f6170702d73746f72652d636f6e6e6563742d6170692f726571756972652f706870)](https://packagist.org/packages/cantie/app-store-connect-api)

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 = Carbon::now()->addMinutes(10)->timestamp;
    return $jwtToken;
}
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance58

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity26

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

279d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/fb8ae5b83a9f07fd9dc0e696f2aa8c8d3175f01ea4aa6338e402759ee5f3dde7?d=identicon)[wenshunbiao](/maintainers/wenshunbiao)

---

Top Contributors

[![wenshunbiao](https://avatars.githubusercontent.com/u/32411020?v=4)](https://github.com/wenshunbiao "wenshunbiao (2 commits)")

---

Tags

phpappleappstoreappstore-api

### Embed Badge

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

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

###  Alternatives

[googleads/googleads-php-lib

Google Ad Manager SOAP API Client Library for PHP

67410.3M25](/packages/googleads-googleads-php-lib)[cantie/app-store-connect-api

A PHP client library for accessing App Store Connect APIs

2831.4k](/packages/cantie-app-store-connect-api)[aporat/store-receipt-validator

PHP receipt validator for Apple App Store and Amazon Appstore

6503.9M9](/packages/aporat-store-receipt-validator)[checkout/checkout-sdk-php

Checkout.com SDK for PHP

553.3M7](/packages/checkout-checkout-sdk-php)[nullform/app-store-server-api-client

PHP client for App Store Server API and App Store Server Notifications

131.3k](/packages/nullform-app-store-server-api-client)

PHPackages © 2026

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