diff --git a/specification/paths/Returns-v1-returns-return_id-reject.json b/specification/paths/Returns-v1-returns-return_id-reject.json index e09dd4fe..0e66e22d 100644 --- a/specification/paths/Returns-v1-returns-return_id-reject.json +++ b/specification/paths/Returns-v1-returns-return_id-reject.json @@ -17,6 +17,28 @@ ], "summary": "Reject a return.", "description": "This endpoint modifies the status of a return resource to `return-rejected`", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "properties": { + "message": { + "type": "string", + "maxLength": 255, + "description": "Message explaining the reason for rejection.", + "example": "The items you've selected are not eligible to be returned because..." + } + } + } + } + } + } + } + }, "responses": { "204": { "description": "The return is rejected." diff --git a/specification/schemas/hooks/HookActionRejectReturn.json b/specification/schemas/hooks/HookActionRejectReturn.json index 179124ed..e425010c 100644 --- a/specification/schemas/hooks/HookActionRejectReturn.json +++ b/specification/schemas/hooks/HookActionRejectReturn.json @@ -6,6 +6,24 @@ "type": "string", "pattern": "^reject-return$", "example": "reject-return" + }, + "values": { + "type": "array", + "items": { + "type": "object", + "additionalProperties": false, + "properties": { + "message": { + "type": [ + "string", + "null" + ], + "maxLength": 255, + "description": "Message explaining the reason for rejection.", + "example": "The items you've selected are not eligible to be returned because..." + } + } + } } } } diff --git a/specification/schemas/returns/Return.json b/specification/schemas/returns/Return.json index eabe9f08..502e30a9 100644 --- a/specification/schemas/returns/Return.json +++ b/specification/schemas/returns/Return.json @@ -61,6 +61,12 @@ "description": "The language that is used for emails for this return. Defaults to the shop's locale." } ] + }, + "rejection_message": { + "type": "string", + "maxLength": 255, + "example": "The items you've selected are not eligible to be returned because...", + "description": "Message explaining the reason the return was rejected (if at all)." } } },