feat: add external demand to sponsored listings auction#199
Merged
jilanglois merged 4 commits intomainfrom Mar 3, 2026
Merged
Conversation
eosorted
approved these changes
Feb 27, 2026
jconnolly200
approved these changes
Feb 27, 2026
jconnolly200
left a comment
There was a problem hiding this comment.
Looks good assuming it renders properly
Comment on lines
+1427
to
+1431
| $ref: "#/components/schemas/WinnerRank" | ||
| type: | ||
| $ref: "#/components/schemas/WinnerType" | ||
| enum: | ||
| - product |
There was a problem hiding this comment.
Bug: The ExternalDemandSponsoredListingsWinner schema incorrectly restricts the type field to product, preventing non-product Topsort winners (e.g., vendor, brand) from being returned in external demand auctions.
Severity: MEDIUM
Suggested Fix
Modify the type property within the ExternalDemandSponsoredListingsWinner schema to allow all valid winner types: ['product', 'vendor', 'brand', 'url']. This aligns it with the SponsoredListingsWinner schema and correctly reflects that Topsort-sourced winners in an external demand auction can be of any type, not just product.
Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: topsort-api-v2.yml#L1427-L1431
Potential issue: The `ExternalDemandSponsoredListingsWinner` schema restricts the `type`
field to an enum containing only `'product'`. However, in an external demand auction,
internal Topsort campaigns can compete, and these campaigns can be of type `'product'`,
`'vendor'`, `'brand'`, or `'url'`. While external demand sources are limited to product
bids, a Topsort campaign of a non-product type could still win the auction. If a
`'vendor'` or `'brand'` campaign wins, the API response would contain a `type` value
that violates the schema, potentially causing validation failures in client
applications.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Added external demand fields to auction request and new option for sponsored listings winners with external demand.
Doc: Demand Mediation API
The

demandSourcesrequest field is added to the sponsored listings request object. The response for sponsored listings with external demand is a new object/option: the schema is a bit different so I think it is better for it to be a stand alone object/optionBonus: Fix indentation for examples to show up.