Create listing
Changed onCreate a new listing with variants
Creates a listing with stock lots that have variant attributes (quality tier, crafted source, etc). Uses database transaction for atomicity. Supports unified pricing (one price for all variants) or per-variant pricing (different prices per quality tier).
The variant deduplication logic ensures that variants with identical attributes are reused across listings, preventing duplicate variant records.
Requirements:
- 14.1: POST /api/v2/listings endpoint
- 14.2: Accept title, description, game_item_id
- 14.3: Accept pricing_mode and base_price
- 14.4: Accept array of lots with variant_attributes
- 14.5: Create or reuse variants based on variant_attributes
- 14.6: Create stock_lots for each lot
- 14.7: Use database transaction for atomicity
- 14.8: Validate all inputs before creating listing
- 14.9: Return created listing with listing_id
- 14.11: Validate seller ownership before creation
Request
- Base URL: /api/v2 (relative, and the document was published on a file host, not at the API’s origin)
- URL: /api/v2/listings
- Auth: verified (a scheme the document does not define)
Request body
Response
Created listing with listing_id
Changes
- ○
added the new optional request property
- ○
- ▲
added the new required request property
- ▲
removed the required property
from the response with the status - ▲
removed the required property
from the response with the status - ●
removed the request property
- ○
added the required property
to the response with the status
- ▲