Amazon Sales API Adds Program Filtering Parameter to getOrderMetrics
Amazon’s SP‑API Sales endpoint now includes an optional enum parameter `amazonProgram` in the `getOrderMetrics` operation. The first supported value is `AmazonHaul`; passing null or omitting the argument returns the historic aggregate view. SDKs regenerated from the updated OpenAPI spec will expose the new third argument, and calls that don’t supply it will fail to compile.
Overview
Amazon is adding an optional amazonProgram parameter to the Selling Partner API (SP‑API) Sales endpoint getOrderMetrics. The new enum lets developers request metrics for a specific Amazon marketplace program, beginning with AmazonHaul. The change is optional at the API level, but any client library regenerated from the updated OpenAPI spec will include the new argument, so sellers and developers must adjust their code to keep calls working.
Key Points
- New enum parameter —
amazonProgramappears as an optional string enum in thegetOrderMetricsoperation. - First value is AmazonHaul — The enum currently supports the value
AmazonHaul, which isolates metrics for Amazon’s discount‑shopping program. - Null retains current behavior — Passing
nullor omitting the parameter returns the same aggregated metrics that sellers have been using today. - Client regeneration required — Auto‑generated SDKs built from the revised specification will expose a new method signature; every call must be updated or will fail to compile.
- Custom integrations stay functional — Hand‑written API calls are not forced to include the parameter, but adding support is recommended for future‑proofing.
How the New Parameter Works
-
Add the enum argument — When the SDK is regenerated, the
getOrderMetricsmethod signature expands to includeamazonProgram.- Example:
client.getOrderMetrics(startDate, endDate, amazonProgram)whereamazonProgramcan be"AmazonHaul"ornull.
- Example:
-
Select a program or use null — If a seller wants metrics only for Amazon Haul, they pass the string
"AmazonHaul"; if they want the historic all‑program view, they pass .
Analysis & Recommendations
Why This Matters
Developers must audit every `getOrderMetrics` call and add a third argument (null or "AmazonHaul") before regenerating SDKs, otherwise their code will not compile. Using "AmazonHaul" isolates metrics for that program, e.g., a January 2024 report may drop from 5,000 units to 1,200 units, giving clearer insight. Future program values will be added to the same enum, so early enum‑aware handling fu...
Key Takeaways
- New optional enum `amazonProgram` is added to `getOrderMetrics`.
- The enum currently supports the value "AmazonHaul"; null retains existing behavior.
- Regenerated SDKs will require a third argument or compilation will fail.
Recommended Actions
- →Search your codebase for `getOrderMetrics(` calls and add a third argument set to null (e.g., in IDE or repo search).
- →Regenerate your SP‑API SDK from the updated OpenAPI spec via the Amazon Developer Portal and rebuild the project.
- →If you sell on Amazon Haul, replace the null with "AmazonHaul" in the call to retrieve program‑specific metrics.
Comments
Join the discussion
Log in or create an account to share your thoughts on this update.
No comments yet. Be the first to share your thoughts!