Skip to content

Conversation

@hsbt
Copy link
Member

@hsbt hsbt commented Jan 7, 2026

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 br resoruce.

Copilot AI review requested due to automatic review settings January 7, 2026 09:18
Copy link

Copilot AI left a 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.Price to OffersV2.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.

Comment on lines +79 to +80
# OffersV2 API response structure
item["OffersV2"]["Listings"][0]["Price"]["Money"]["DisplayAmount"]
Copy link

Copilot AI Jan 7, 2026

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.

Copilot uses AI. Check for mistakes.
Comment on lines +42 to +46
"OffersV2.Listings.Price",
"OffersV2.Listings.MerchantInfo",
"OffersV2.Listings.Availability",
"OffersV2.Listings.Condition",
"OffersV2.Listings.IsBuyBoxWinner"
Copy link

Copilot AI Jan 7, 2026

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.

Suggested change
"OffersV2.Listings.Price",
"OffersV2.Listings.MerchantInfo",
"OffersV2.Listings.Availability",
"OffersV2.Listings.Condition",
"OffersV2.Listings.IsBuyBoxWinner"
"OffersV2.Listings.Price"

Copilot uses AI. Check for mistakes.
@hsbt hsbt merged commit f368c0f into master Jan 7, 2026
22 checks passed
@hsbt hsbt deleted the offersv2 branch January 7, 2026 09:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants