{"id":13748846,"url":"https://github.com/clousale/amazon-sp-api-php","last_synced_at":"2025-05-09T11:31:32.815Z","repository":{"id":37251029,"uuid":"300268300","full_name":"clousale/amazon-sp-api-php","owner":"clousale","description":"This is an API Binding in PHP for the new Amazon Selling Partner API.","archived":true,"fork":false,"pushed_at":"2022-07-07T19:58:04.000Z","size":1917,"stargazers_count":139,"open_issues_count":85,"forks_count":154,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-04-26T13:05:08.552Z","etag":null,"topics":["amazon","composer","mws","php","selling-partner-api","sp-api"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":false,"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/clousale.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-01T12:17:38.000Z","updated_at":"2024-03-27T20:18:31.000Z","dependencies_parsed_at":"2022-07-09T13:00:31.543Z","dependency_job_id":null,"html_url":"https://github.com/clousale/amazon-sp-api-php","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clousale%2Famazon-sp-api-php","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clousale%2Famazon-sp-api-php/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clousale%2Famazon-sp-api-php/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/clousale%2Famazon-sp-api-php/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/clousale","download_url":"https://codeload.github.com/clousale/amazon-sp-api-php/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253240350,"owners_count":21876593,"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":["amazon","composer","mws","php","selling-partner-api","sp-api"],"created_at":"2024-08-03T07:00:50.789Z","updated_at":"2025-05-09T11:31:27.944Z","avatar_url":"https://github.com/clousale.png","language":"PHP","readme":"# This project is not maintained anymore\n\nThis project is not maintained anymore. We recommend to use the [jlevers/selling-partner-api](https://github.com/jlevers/selling-partner-api) package.\n\n# Amazon Selling Partner API PHP \n\nThis is an API Binding in PHP for the new Amazon Selling Partner API.\n\nThis library is based on the output of `swagger-codegen` with the [OpenAPI files provided by Amazon](https://github.com/amzn/selling-partner-api-models/tree/main/models) and has been modified by the contributors.\n\nThe purpose of this package is to have an easy way of getting started with the Amazon Selling Partner API through a simple composer package.\n\n# Requirements\n\n- PHP \u003e= 7.3\n- cURL Extension\n- JSON Extension\n- MBString Extension\n\n# Installation\n\nJust require this package via composer:\n\n```\ncomposer require clousale/amazon-sp-api-php\n```\n\n# Detailed Documentation\n\nYou can find detailed documentation for this PHP Library in the [`docs/Api` directory](https://github.com/clousale/amazon-sp-api-php/tree/master/docs/Api) (Please note: Namespaces and other classes could have been changed)\n\nYou can find general information about the Amazon Selling Partner API on [the official Amazon Developer Website](https://developer.amazonservices.com).\n\n# Examples\n\nThese are simple examples, just to show you how to get started calling the API.\n\n## IAM Role\n\nFor when you entered the IAM Role ARN in your developer profile:\n\n```php\n\u003c?php\n\nrequire_once './vendor/autoload.php';\n\n$options = [\n    'refresh_token' =\u003e '', // Aztr|...\n    'client_id' =\u003e '', // App ID from Seller Central, amzn1.sellerapps.app.cfbfac4a-......\n    'client_secret' =\u003e '', // The corresponding Client Secret\n    'region' =\u003e \\ClouSale\\AmazonSellingPartnerAPI\\SellingPartnerRegion::$EUROPE, // or NORTH_AMERICA / FAR_EAST\n    'access_key' =\u003e '', // Access Key of AWS IAM User, for example AKIAABCDJKEHFJDS\n    'secret_key' =\u003e '', // Secret Key of AWS IAM User\n    'endpoint' =\u003e \\ClouSale\\AmazonSellingPartnerAPI\\SellingPartnerEndpoint::$EUROPE, // or NORTH_AMERICA / FAR_EAST\n    'role_arn' =\u003e '', // AWS IAM Role ARN for example: arn:aws:iam::123456789:role/Your-Role-Name\n];\n$accessToken = \\ClouSale\\AmazonSellingPartnerAPI\\SellingPartnerOAuth::getAccessTokenFromRefreshToken(\n    $options['refresh_token'],\n    $options['client_id'],\n    $options['client_secret']\n);\n$assumedRole = \\ClouSale\\AmazonSellingPartnerAPI\\AssumeRole::assume(\n    $options['region'],\n    $options['access_key'],\n    $options['secret_key'],\n    $options['role_arn'],\n);\n$config = \\ClouSale\\AmazonSellingPartnerAPI\\Configuration::getDefaultConfiguration();\n$config-\u003esetHost($options['endpoint']);\n$config-\u003esetAccessToken($accessToken);\n$config-\u003esetAccessKey($assumedRole-\u003egetAccessKeyId());\n$config-\u003esetSecretKey($assumedRole-\u003egetSecretAccessKey());\n$config-\u003esetRegion($options['region']);\n$config-\u003esetSecurityToken($assumedRole-\u003egetSessionToken());\n$apiInstance = new \\ClouSale\\AmazonSellingPartnerAPI\\Api\\CatalogApi($config);\n$marketplace_id = 'A1PA6795UKMFR9';\n$asin = 'B0002ZFTJA';\n\n$result = $apiInstance-\u003egetCatalogItem($marketplace_id, $asin);\necho $result-\u003egetPayload()-\u003egetAttributeSets()[0]-\u003egetTitle(); // Never Gonna Give You Up [Vinyl Single]\n```\n\n## IAM User\n\nWhen you entered the User ARN instead of the Role ARN, please use this example:\n\n```php\n\u003c?php\n\nrequire_once './vendor/autoload.php';\n\n$options = [\n    'refresh_token' =\u003e '', // Aztr|...\n    'client_id' =\u003e '', // App ID from Seller Central, amzn1.sellerapps.app.cfbfac4a-......\n    'client_secret' =\u003e '', // The corresponding Client Secret\n    'region' =\u003e \\ClouSale\\AmazonSellingPartnerAPI\\SellingPartnerRegion::$EUROPE, // or NORTH_AMERICA / FAR_EAST\n    'access_key' =\u003e '', // Access Key of AWS IAM User, for example AKIAABCDJKEHFJDS\n    'secret_key' =\u003e '', // Secret Key of AWS IAM User\n    'endpoint' =\u003e \\ClouSale\\AmazonSellingPartnerAPI\\SellingPartnerEndpoint::$EUROPE, // or NORTH_AMERICA / FAR_EAST\n];\n$accessToken = \\ClouSale\\AmazonSellingPartnerAPI\\SellingPartnerOAuth::getAccessTokenFromRefreshToken(\n    $options['refresh_token'],\n    $options['client_id'],\n    $options['client_secret']\n);\n$config = \\ClouSale\\AmazonSellingPartnerAPI\\Configuration::getDefaultConfiguration();\n$config-\u003esetHost($options['endpoint']);\n$config-\u003esetAccessToken($accessToken);\n$config-\u003esetAccessKey($options['access_key']);\n$config-\u003esetSecretKey($options['secret_key']);\n$config-\u003esetRegion($options['region']);\n$apiInstance = new \\ClouSale\\AmazonSellingPartnerAPI\\Api\\CatalogApi($config);\n$marketplace_id = 'A1PA6795UKMFR9';\n$asin = 'B0002ZFTJA';\n\n$result = $apiInstance-\u003egetCatalogItem($marketplace_id, $asin);\necho $result-\u003egetPayload()-\u003egetAttributeSets()[0]-\u003egetTitle(); // Never Gonna Give You Up [Vinyl Single]\n```\n\n# ToDo\n\n- Implement Tests\n- Improve documentation\n\nFeature Requests \u0026 Pull Requests are very welcome!\n\n# Notes\n\nIf you are looking for a complete Repricing \u0026 FBA-Reimbursement solution, you might want to consider giving [ClouSale.com](https://www.clousale.com) a shot.\n\n# Thanks\n\nThanks go out to everybody who added PRs and worked on this package.\n","funding_links":[],"categories":["Docs"],"sub_categories":["Library"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclousale%2Famazon-sp-api-php","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fclousale%2Famazon-sp-api-php","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fclousale%2Famazon-sp-api-php/lists"}