-
Notifications
You must be signed in to change notification settings - Fork 69
Use OffersV2 resource for PA-API 5.0 #1290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR migrates the Amazon PA-API integration from Offers V1 to OffersV2 API before the V1 service ends on January 31, 2026, and fixes a syntax error in the Brazil market configuration.
Key changes:
- Updated API resource requests from
Offers.Listings.PricetoOffersV2.Listings.Price(plus additional OffersV2 resources) - Modified price data access path to match OffersV2 response structure:
OffersV2 → Listings → Price → Money → DisplayAmount - Fixed missing comma in Brazil market configuration that would have caused a syntax error
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| lib/aws/pa_api.rb | Updates API resource requests to use OffersV2 resources and fixes syntax error in Brazil market configuration (missing comma between host and region parameters) |
| misc/plugin/amazon.rb | Updates price extraction path to navigate OffersV2 response structure with the additional "Money" level in the hierarchy |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| # OffersV2 API response structure | ||
| item["OffersV2"]["Listings"][0]["Price"]["Money"]["DisplayAmount"] |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After this API migration, existing cached JSON files will contain the old "Offers" structure instead of "OffersV2". While the rescue block will handle this gracefully by returning '(no price)', consider documenting in the PR description or release notes that users should clear their Amazon plugin cache after updating to avoid confusion with missing prices until the cache naturally expires and refreshes.
| "OffersV2.Listings.Price", | ||
| "OffersV2.Listings.MerchantInfo", | ||
| "OffersV2.Listings.Availability", | ||
| "OffersV2.Listings.Condition", | ||
| "OffersV2.Listings.IsBuyBoxWinner" |
Copilot
AI
Jan 7, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The resources "OffersV2.Listings.MerchantInfo", "OffersV2.Listings.Availability", "OffersV2.Listings.Condition", and "OffersV2.Listings.IsBuyBoxWinner" are being requested but are not currently used anywhere in the codebase. Consider removing these unused resources to reduce API response payload size, or add a comment explaining if they are reserved for future use.
| "OffersV2.Listings.Price", | |
| "OffersV2.Listings.MerchantInfo", | |
| "OffersV2.Listings.Availability", | |
| "OffersV2.Listings.Condition", | |
| "OffersV2.Listings.IsBuyBoxWinner" | |
| "OffersV2.Listings.Price" |
PA-API Offers V1 will end its service on January 31, 2026. We need to migrate it to V2.
https://webservices.amazon.com/paapi5/documentation/offersV2.html
And I fixed syntax error of
brresoruce.