Implemented the POST /marketplace/listings/{listing_id} endpoint for the Open API specification document in the library target.

This commit is contained in:
2025-10-21 20:34:18 +02:00
parent 69b366390c
commit 1ac2629d56
+113
View File
@@ -1907,6 +1907,43 @@ paths:
$ref: '#/components/responses/Unprocessable'
'500':
$ref: '#/components/responses/InternalError'
post:
tags:
- Marketplace
summary: Update a listing in a marketplace.
description: |
Edits the data associated with a listing in a marketplace.
In case a status of a listingis not `For Sale`, `Draft`, or `Expired`, it cannot be modified - only deleted. To re-list a Sold listing, a new listing must be created.
This endpoint requires authentication as a listing owner.
operationId: editListing
parameters:
- $ref: '#/components/parameters/ListingId'
requestBody:
$ref: '#/components/requestBodies/Listing'
security:
- ConsumerKeySecret: []
- UserToken: []
- OAuth: []
responses:
'204':
description: Successfully edited a listing from a marketplace.
headers:
X-Discogs-RateLimit:
$ref: '#/components/headers/RateLimit'
X-Discogs-RateLimit-Used:
$ref: '#/components/headers/RateLimitUsed'
X-Discogs-RateLimit-Remaining:
$ref: '#/components/headers/RateLimitRemaining'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/NotAccessable'
'422':
$ref: '#/components/responses/Unprocessable'
'500':
$ref: '#/components/responses/InternalError'
delete:
tags:
- Marketplace
@@ -1934,6 +1971,8 @@ paths:
$ref: '#/components/headers/RateLimitRemaining'
'401':
$ref: '#/components/responses/Unauthorized'
'403':
$ref: '#/components/responses/NotAccessable'
'500':
$ref: '#/components/responses/InternalError'
components:
@@ -2271,6 +2310,80 @@ components:
type: string
example: memory
requestBodies:
Listing:
description: A container to use in case of either creating a new release into a marketplace or midfying a release already existing in a marketplace.
required: true
content:
application/json:
schema:
properties:
listing_id:
description: An identifier of a listing, if any.
type: integer
minimum: 0
release_id:
description: An identifier of a release.
type: integer
minimum: 0
condition:
description: A media condition of a listing.
$ref: '#/components/schemas/ConditionMedia'
sleeve_condition:
description: A sleeve condition of a listing.
$ref: '#/components/schemas/ConditionSleeve'
price:
description: A price of a listing in a seller's currency.
type: number
format: float
minimum: 0
comments:
description: Any remark about a listing that would be shown to buyers.
type: string
allow_offers:
description: A flag that indicates whether buyers are allowed to make offers for a listing or not.
type: boolean
status:
description: A status explanation of a listing.
type: string
enum:
- Draft
- For Sale
default: Draft
external_id:
description: |
A freeform field that could be used by a seller to comment about a listing.
The information stored in this field is not shown to anobody except a seller who owns a listing.
type: string
location:
description: |
A geographical location of a listing.
The information stored in this field is not shown to anobody except a seller who owns a listing.
type: string
weight:
description: A weight of a listing in grams for the purpose of calculating shipping costs.
anyOf:
- type: number
format: float
- type: string
enum:
- auto
default: auto
format_quantity:
description: A number of items of a listing, for the purpose of calculating shipping costs.
anyOf:
- type: number
format: float
- type: string
enum:
- auto
default: auto
required:
- condition
- price
- release_id
- status
MoveInstance:
description: A container to use in case of moving a release instance from a collection folder into another.
required: false