{"id":15659669,"url":"https://github.com/mikebarlow/itc-reporter","last_synced_at":"2025-04-10T18:23:14.283Z","repository":{"id":57054489,"uuid":"71441099","full_name":"mikebarlow/itc-reporter","owner":"mikebarlow","description":"PHP replacement package for Apples Java based Reporter.jar for download iTunes Connect stats.","archived":false,"fork":false,"pushed_at":"2024-05-13T14:40:50.000Z","size":52,"stargazers_count":22,"open_issues_count":2,"forks_count":12,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-24T16:03:49.449Z","etag":null,"topics":["financial-reports","itc-reporter","itunes","itunes-api","itunesconnect","php","sales-report"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mikebarlow.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-10-20T08:25:34.000Z","updated_at":"2024-12-31T10:14:07.000Z","dependencies_parsed_at":"2024-10-23T06:25:34.927Z","dependency_job_id":"85fd408e-9cb3-494d-abe3-87155690f5b2","html_url":"https://github.com/mikebarlow/itc-reporter","commit_stats":{"total_commits":64,"total_committers":6,"mean_commits":"10.666666666666666","dds":0.34375,"last_synced_commit":"a72f77864b8de28b4fbd1bacf6be8f5b69c13855"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikebarlow%2Fitc-reporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikebarlow%2Fitc-reporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikebarlow%2Fitc-reporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mikebarlow%2Fitc-reporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mikebarlow","download_url":"https://codeload.github.com/mikebarlow/itc-reporter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248270597,"owners_count":21075795,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["financial-reports","itc-reporter","itunes","itunes-api","itunesconnect","php","sales-report"],"created_at":"2024-10-03T13:18:11.030Z","updated_at":"2025-04-10T18:23:14.263Z","avatar_url":"https://github.com/mikebarlow.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# iTunes Connect Reporter (ITC Reporter)\n\n[![Author](http://img.shields.io/badge/author-@mikebarlow-red.svg?style=flat-square)](https://twitter.com/mikebarlow)\n[![Source Code](http://img.shields.io/badge/source-mikebarlow/itc--reporter-brightgreen.svg?style=flat-square)](https://github.com/mikebarlow/itc-reporter)\n[![Latest Version](https://img.shields.io/github/release/mikebarlow/itc-reporter.svg?style=flat-square)](https://github.com/mikebarlow/itc-reporter/releases)\n[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](https://github.com/mikebarlow/itc-reporter/blob/master/LICENSE)\n[![Build Status](https://img.shields.io/travis/mikebarlow/itc-reporter/master.svg?style=flat-square)](https://travis-ci.org/mikebarlow/itc-reporter)\n\n## Introduction\n\nITC Reporter is a PSR-2 compliant package used for getting data from iTunes Connect. It acts as a PHP port of the Java based reporter.jar that apple provide [here](https://help.apple.com/itc/appsreporterguide/#/itc0f2481229).\n\nThe current Autoingestion Tool will cease to work from the end of November 2016 and they recommended everyone switch to use the new Reporter tool in this [post](https://itunespartner.apple.com/en/apps/news/47110289).\n\nThis is the first PHP Composer based port of the Reporter tool and attempts to make using the tool and reports easier by processing the XML that is returned by the API and returning it as an Array to make usage easier.\n\n## Requirements\n\n### Composer\n\nITC-Reporter requires the following:\n\n* \"php\": \"\u003e=5.5.0\"\n* \"guzzlehttp/guzzle\": \"6.*\"\n* \"snscripts/result\": \"1.0.*\"\n\nAnd the following if you wish to run in dev mode and run tests.\n\n* \"phpunit/phpunit\": \"~4.0\"\n* \"squizlabs/php_codesniffer\": \"~2.0\"\n\n## Installation\n\n### Composer\n\nSimplest installation is via composer.\n\n\tcomposer require snscripts/itc-reporter 2.*\n\nor adding to your projects `composer.json` file.\n\n\t{\n\t    \"require\": {\n\t        \"snscripts/itc-reporter\": \"2.*\"\n\t    }\n\t}\n\n### Setup\n\nInstantiate the class as follows.\n\n\t$Reporter = new \\Snscripts\\ITCReporter\\Reporter(\n\t\tnew \\GuzzleHttp\\Client\n\t);\n\n## Usage\n\n### Basics\n\nAside from the main methods that return the data, all methods support chaining.\n\nTo use the Reporter, you will need the an access token for your iTunes Connect account. This is obtained from the [iTunes Connect Sales and Trends screen](https://reportingitc2.apple.com/reports.html), as described in the [Reporter documentation](https://help.apple.com/itc/appsreporterguide/#/apd2f1f1cfa3). Set the access token as follows.\n\n\t$Reporter-\u003esetAccessToken('12345678-1234-abcd-abcd-12345678abcd');\n\nThere are also \"getter\" methods to retrieve the currently set data.\n\n\t$Reporter-\u003egetAccessToken();\n\nBefore progressing any further with this package, it will be worth while reviewing Apples Documentation at [https://help.apple.com/itc/appsreporterguide/](https://help.apple.com/itc/appsreporterguide/).\n\n### Account Numbers\n\nMost actions require an account number also setting. You can retrieve the accounts your user has available for both \"Sales \u0026 Trends\" and \"Payments \u0026 Financial Reports\" by using the following functions.\n\n\t$Reporter-\u003egetSalesAccounts();\n\t$Reporter-\u003egetFinanceAccounts();\n\nBoth of these return data in the same array format. If you have no access to any accounts a blank array will be returned. If you do have access they will return an array in the following format.\n\n\t[\n\t    1234567 =\u003e [\n\t        'Name' =\u003e 'John Smith',\n\t        'Number' =\u003e 1234567\n\t    ],\n\t    9876543 =\u003e [\n\t        'Name' =\u003e 'Jane Doe',\n\t        'Number' =\u003e 9876543\n\t    ]\n\t]\n\nThe 'Number' element is the account number that is needed for the rest of the endpoints.\n\nYou can set the account number you wish to use by calling;\n\n\t$Reporter-\u003esetAccountNum(1234567);\n\nYou can then also retrieve the currently set account number with:\n\n\t$Reporter-\u003egetAccountNum();\n\n### Vendor Number\n\nOne last ID needed before a report can be retrieved is the Vendor number. Before you can get the list of vendors an Account Number does need to be set.\n\nOnce an Account Number is set you can get the Vendors for both \"Sales \u0026 Trends\" and \"Payments \u0026 Financial Reports\", the data returned for Sales \u0026 Trends Vendors differs from Payments \u0026 Financial Vendors.\n\nIn both instances, if no vendors exists, a blank array will be returned.\n\n#### Sales Vendors\n\nUse the following function to get the Vendors for the Sales \u0026 Trends\n\n\t$Reporter-\u003egetSalesVendors();\n\nThis will return a simple array of Vendor numbers.\n\n\t[\n        1234567,\n        9876543\n    ]\n\n#### Finance Vendors\n\nUse the following function get the Vendors for the Payments \u0026 Financial Reports.\n\n\t$Reporter-\u003egetFinanceVendors();\n\nThis returns a slightly more complicated array, detailing the Vendor, the Region Codes available and the Reports available for each Region Code.\n\n    [\n        1234567 =\u003e [\n            'Number' =\u003e 1234567,\n            'Regions' =\u003e [\n                'AE' =\u003e [\n                    'Code' =\u003e 'AE',\n                    'Reports' =\u003e [\n                        'Financial'\n                    ]\n                ],\n                'AU' =\u003e [\n                    'Code' =\u003e 'AU',\n                    'Reports' =\u003e [\n                        'Financial'\n                    ]\n                ]\n            ]\n        ],\n        9876543 =\u003e [\n            'Number' =\u003e 9876543,\n            'Regions' =\u003e [\n                'EU' =\u003e [\n                    'Code' =\u003e 'EU',\n                    'Reports' =\u003e [\n                        'Financial'\n                    ]\n                ]\n            ]\n        ]\n    ]\n\n### Reports\n\nBoth Sales Reports and the Financial Reports require specific data regarding the type of report you want. Consult the documentation for each section so you know what parameters are available.\n\n#### Sales Report\n\nFor Sales reports, consult the documentation [here](https://help.apple.com/itc/appsreporterguide/#/itcbd9ed14ac) to view descriptions of the parameters.\n\nTo get reports call the method in the following way:\n\n\t$Reporter-\u003egetSalesReport(\n\t\t$vendorNum,\n\t\t$reportType,\n\t\t$reportSubType,\n\t\t$dateType,\n\t\t$date\n\t);\n\nAn actual call may look something like this:\n\n\t$Reporter-\u003egetSalesReport(\n\t\t1234567,\n\t\t'Sales',\n\t\t'Summary',\n\t\t'Daily',\n\t\t'20161025' //YYYYMMDD\n\t);\n\nIf nothing was found or a problem occurred, a blank array will be returned. If the report does have data an array similar to below will be returned.\n\n\t[\n        [\n            [Provider] =\u003e APPLE\n            [Provider Country] =\u003e US\n            [SKU] =\u003e 12345678901\n            [Developer] =\u003e John Smith\n            [Title] =\u003e My App\n            [Version] =\u003e 2.0.1\n            [Product Type Identifier] =\u003e 1F\n            [Units] =\u003e 1\n            [Developer Proceeds] =\u003e 0\n            [Begin Date] =\u003e 10/23/2016\n            [End Date] =\u003e 10/23/2016\n            [Customer Currency] =\u003e AUD\n            [Country Code] =\u003e AU\n            [Currency of Proceeds] =\u003e AUD\n            [Apple Identifier] =\u003e 123456789\n            [Customer Price] =\u003e 0\n            [Promo Code] =\u003e\n            [Parent Identifier] =\u003e\n            [Subscription] =\u003e\n            [Period] =\u003e\n            [Category] =\u003e Travel\n            [CMB] =\u003e\n            [Device] =\u003e iPad\n            [Supported Platforms] =\u003e iOS\n            [Proceeds Reason] =\u003e\n            [Preserved Pricing] =\u003e\n            [Client] =\u003e\n        ],\n        [\n            [Provider] =\u003e APPLE\n            [Provider Country] =\u003e US\n            [SKU] =\u003e 12345678901\n            [Developer] =\u003e John Smith\n            [Title] =\u003e My App\n            [Version] =\u003e 2.0.1\n            [Product Type Identifier] =\u003e 3F\n            [Units] =\u003e 1\n            [Developer Proceeds] =\u003e 0\n            [Begin Date] =\u003e 10/23/2016\n            [End Date] =\u003e 10/23/2016\n            [Customer Currency] =\u003e USD\n            [Country Code] =\u003e BR\n            [Currency of Proceeds] =\u003e USD\n            [Apple Identifier] =\u003e 123456789\n            [Customer Price] =\u003e 0\n            [Promo Code] =\u003e\n            [Parent Identifier] =\u003e\n            [Subscription] =\u003e\n            [Period] =\u003e\n            [Category] =\u003e Travel\n            [CMB] =\u003e\n            [Device] =\u003e iPhone\n            [Supported Platforms] =\u003e iOS\n            [Proceeds Reason] =\u003e\n            [Preserved Pricing] =\u003e\n            [Client] =\u003e\n        ]\n\t]\n\n#### Financials- Report\n\nFor Financial reports, consult the documentation [here](https://help.apple.com/itc/appsreporterguide/#/itc21263284f) to view descriptions of the parameters.\n\nTo get reports call the method in the following way:\n\n\t$Reporter-\u003egetFinanceReport(\n\t\t$vendorNum,\n\t\t$regionCode,\n\t\t$reportType,\n\t\t$fiscalYear,\n\t\t$fiscalPeriod\n\t);\n\nAn actual call may look something like this:\n\n\t$Reporter-\u003egetSalesReport(\n\t\t1234567,\n\t\t'GB',\n\t\t'Financial',\n\t\t'2016',\n\t\t'1' //YYYYMMDD\n\t);\n\nIf nothing was found or a problem occurred, a blank array will be returned. If the report does have data an array similar to below will be returned.\n\n\t[\n\t    [\n\t        [Start Date] =\u003e 09/27/2015\n\t        [End Date] =\u003e 10/31/2015\n\t        [UPC] =\u003e\n\t        [ISRC/ISBN] =\u003e\n\t        [Vendor Identifier] =\u003e 123456789012\n\t        [Quantity] =\u003e 22\n\t        [Partner Share] =\u003e 0.46\n\t        [Extended Partner Share] =\u003e 10.12\n\t        [Partner Share Currency] =\u003e GBP\n\t        [Sales or Return] =\u003e S\n\t        [Apple Identifier] =\u003e 123456789\n\t        [Artist/Show/Developer/Author] =\u003e John Smith\n\t        [Title] =\u003e My App\n\t        [Label/Studio/Network/Developer/Publisher] =\u003e\n\t        [Grid] =\u003e\n\t        [Product Type Identifier] =\u003e 1\n\t        [ISAN/Other Identifier] =\u003e\n\t        [Country Of Sale] =\u003e GB\n\t        [Pre-order Flag] =\u003e\n\t        [Promo Code] =\u003e\n\t        [Customer Price] =\u003e 0.79\n\t        [Customer Currency] =\u003e GBP\n\t    ],\n\t    [\n\t        [Start Date] =\u003e 09/27/2015\n\t        [End Date] =\u003e 10/31/2015\n\t        [UPC] =\u003e\n\t        [ISRC/ISBN] =\u003e\n\t        [Vendor Identifier] =\u003e 123789456\n\t        [Quantity] =\u003e 1\n\t        [Partner Share] =\u003e 0.46\n\t        [Extended Partner Share] =\u003e 0.46\n\t        [Partner Share Currency] =\u003e GBP\n\t        [Sales or Return] =\u003e S\n\t        [Apple Identifier] =\u003e 987654321\n\t        [Artist/Show/Developer/Author] =\u003e John Smith\n\t        [Title] =\u003e My App 2\n\t        [Label/Studio/Network/Developer/Publisher] =\u003e\n\t        [Grid] =\u003e\n\t        [Product Type Identifier] =\u003e 1F\n\t        [ISAN/Other Identifier] =\u003e\n\t        [Country Of Sale] =\u003e GB\n\t        [Pre-order Flag] =\u003e\n\t        [Promo Code] =\u003e\n\t        [Customer Price] =\u003e 0.79\n\t        [Customer Currency] =\u003e GBP\n\t    ],\n\t    [Total_Rows] =\u003e 6\n\t    [Total_Amount] =\u003e 28.32\n\t    [Total_Units] =\u003e 58\n\t]\n\n## Debugging\n\nIf you've run a method to get a report or account / vendor numbers to find you are not getting the results expected, you can retrieve the last Result object returned, this method should contain any information relating to why a request may have failed.\n\n    $Reporter = new \\Snscripts\\ITCReporter\\Reporter(\n        new \\GuzzleHttp\\Client\n    );\n\n    $Reporter-\u003esetAccessToken('12345678-1234-abcd-abcd-12345678abcd');\n\n    $failedAccounts = $Reporter-\u003egetSalesAccount();\n\n    $Result = $Reporter-\u003egetLastResult();\n\nIf no action has been run, the result will return a `null` value.\n\n## Changelog\n\nYou can view the changelog [HERE](https://github.com/mikebarlow/itc-reporter/blob/master/CHANGELOG.md)\n\n## Contributing\n\nPlease see [CONTRIBUTING](https://github.com/mikebarlow/itc-reporter/blob/master/CONTRIBUTING.md) for details.\n\n## License\n\nThe MIT License (MIT). Please see [License File](https://github.com/mikebarlow/itc-reporter/blob/master/LICENSE) for more information.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikebarlow%2Fitc-reporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmikebarlow%2Fitc-reporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmikebarlow%2Fitc-reporter/lists"}