Skip to content

Migrate from PA-API v5 to Amazon Creators API#54

Merged
fumikito merged 5 commits intomasterfrom
feature/creators-api
Jan 30, 2026
Merged

Migrate from PA-API v5 to Amazon Creators API#54
fumikito merged 5 commits intomasterfrom
feature/creators-api

Conversation

@fumikito
Copy link
Member

Summary

  • Amazon PA-API v5 (Offers V1) が 2026年1月31日に廃止されるため、Creators API へ移行
  • PHP 8.1以上が必須に(破壊的変更)
  • 新しい認証情報(Credential ID / Credential Secret)が必要

Changes

SDK

  • app/Amazon/ に Amazon Creators API SDK 1.1.2 を配置
  • PSR-4 autoload 設定追加
  • 旧 PA-API SDK (thewirecutter/paapi5-php-sdk) を削除

Core Code

  • AmazonConstants.php: Creators API 対応に書き換え
    • searchItems($request)searchItems($marketplace, $request)
    • getOffers()getOffersV2()
    • リソース定数を更新
  • AmazonLocales.php: get_marketplace() / get_version() 追加
  • Amazon.php: 認証情報フィールド変更
    • accessKeycredentialId
    • secretKeycredentialSecret

Build & Lint

  • bin/lint-sdk.php 追加(SDK構文チェック)
  • bin/replacer.php 削除(旧SDK用、不要に)
  • phpcs.ruleset.xml 更新(SDKを除外)

Breaking Changes

  • PHP 8.1 以上が必須
  • 旧認証情報(Access Key / Secret Key)は使用不可
  • Associates Central > Tools > Creator API から新しい認証情報を取得する必要あり

Note

Amazon Creators API は過去30日間に10件以上の売上がないとAPIアクセスが制限されます。
売上要件を満たさない場合は、5.2.0で追加されたfallback機能が自動的に使用されます。

Test plan

  • SDK構文チェック(php bin/lint-sdk.php
  • PHPCSリント(composer lint
  • ユニットテスト
  • 実際のAPI動作確認(要:10件以上の売上実績があるアカウント)

🤖 Generated with Claude Code

fumikito and others added 5 commits January 30, 2026 14:05
- Replace PA-API v5 SDK with Creators API SDK (app/Amazon/)
- Update PHP requirement to 8.1+
- Update Guzzle to v7.x
- Add autoload configuration for Amazon namespace
- Exclude Amazon SDK from phpcs checks
- Add app/README.md with SDK update instructions

Co-authored-by: Claude <noreply@anthropic.com>
- Add <file> tags in phpcs.ruleset.xml to specify scan targets
- Remove find command from composer lint/fix scripts
- Prevents memory exhaustion from scanning Amazon SDK files

Co-authored-by: Claude <noreply@anthropic.com>
- AmazonConstants.php: Use Creators API SDK classes, change from
  searchItems(request) to searchItems(marketplace, request), update
  OffersV2 price access, change cache key prefix
- AmazonLocales.php: Add get_marketplace() and get_version() methods
  for Creators API version mapping (NA:2.1, EU:2.2, FE:2.3)
- Amazon.php: Change credentials from accessKey/secretKey to
  credentialId/credentialSecret, update service description

Co-authored-by: Claude <noreply@anthropic.com>
- Add bin/lint-sdk.php for checking SDK PHP syntax
- Remove bin/replacer.php (PA-API SDK fixer no longer needed)
- Update README with Creators API migration notes and breaking changes
- Document PHP 8.1 requirement

Co-authored-by: Claude <noreply@anthropic.com>
@fumikito fumikito enabled auto-merge January 30, 2026 12:12
@fumikito fumikito merged commit e384706 into master Jan 30, 2026
9 checks passed
@fumikito fumikito deleted the feature/creators-api branch January 30, 2026 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant