From 3909f8c8b60c2009beb3306d28d5619fad5df502 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Mon, 10 Nov 2025 00:03:47 +0100 Subject: [PATCH] Implemented the POST /marketplace/orders/{order_id}/messages endpoint for the Open API specification document in the library target. --- Sources/DiscogsService/openapi.yaml | 61 +++++++++++++++++++++++++++-- 1 file changed, 58 insertions(+), 3 deletions(-) diff --git a/Sources/DiscogsService/openapi.yaml b/Sources/DiscogsService/openapi.yaml index d040618ea..b49721ae8 100644 --- a/Sources/DiscogsService/openapi.yaml +++ b/Sources/DiscogsService/openapi.yaml @@ -2116,7 +2116,7 @@ paths: description: | Returns a list orders for a seller in a marketplace. - This endpoints accepts pagination and authentication as a seller. + This endpoints accepts pagination and requires authentication as a seller. operationId: getOrderMessages parameters: - $ref: '#/components/parameters/OrderId' @@ -2158,8 +2158,50 @@ paths: $ref: '#/components/responses/NotAccessable' '404': $ref: '#/components/responses/NotFound' - '422': - $ref: '#/components/responses/Unprocessable' + '500': + $ref: '#/components/responses/InternalError' + post: + tags: + - Marketplace + summary: Add a message to an order. + description: | + Adds a new message to the order’s message log. + + When posting a new message, it is also possible to update the order status. In this case, the message will automatically be prepended with: *Seller changed status from Old Status to New Status* + + While both `message` and `status` properties are each optional, one or both must be present. + + This endpoints requires authentication as a seller. + operationId: addOrderMessage + parameters: + - $ref: '#/components/parameters/OrderId' + requestBody: + $ref: '#/components/requestBodies/OrderMessage' + security: + - ConsumerKeySecret: [] + - UserToken: [] + - OAuth: [] + responses: + '201': + description: Successfully added a new message to a list of messages related to an order. + headers: + X-Discogs-RateLimit: + $ref: '#/components/headers/RateLimit' + X-Discogs-RateLimit-Used: + $ref: '#/components/headers/RateLimitUsed' + X-Discogs-RateLimit-Remaining: + $ref: '#/components/headers/RateLimitRemaining' + content: + application/json: + schema: + description: A message that has been added to an order. + $ref: '#/components/schemas/OrderMessage' + '401': + $ref: '#/components/responses/Unauthorized' + '403': + $ref: '#/components/responses/NotAccessable' + '404': + $ref: '#/components/responses/NotFound' '500': $ref: '#/components/responses/InternalError' components: @@ -2617,6 +2659,19 @@ components: - price - release_id - status + OrderMessage: + description: A container to use in case to add a message to an existing order. + required: true + content: + application/json: + schema: + properties: + message: + description: A message to attach to an order. + type: string + status: + description: A update to a status of an order. + type: string MoveInstance: description: A container to use in case of moving a release instance from a collection folder into another. required: false